Exemple #1
0
func (s *ensureDotProfileSuite) TestIdempotent(c *gc.C) {
	s.writeDotProfile(c, "")
	err := upgrades.EnsureUbuntuDotProfileSourcesProxyFile(s.ctx)
	c.Assert(err, gc.IsNil)
	err = upgrades.EnsureUbuntuDotProfileSourcesProxyFile(s.ctx)
	c.Assert(err, gc.IsNil)
	s.assertProfile(c, expectedLine)
}
Exemple #2
0
func (s *ensureDotProfileSuite) TestProfileUntouchedIfJujuProxyInSource(c *gc.C) {
	content := "source .juju-proxy\n"
	s.writeDotProfile(c, content)
	err := upgrades.EnsureUbuntuDotProfileSourcesProxyFile(s.ctx)
	c.Assert(err, gc.IsNil)
	s.assertProfile(c, content)
}
Exemple #3
0
func (s *ensureDotProfileSuite) TestSkippedIfDotProfileDoesntExist(c *gc.C) {
	err := upgrades.EnsureUbuntuDotProfileSourcesProxyFile(s.ctx)
	c.Assert(err, gc.IsNil)
	c.Assert(path.Join(s.home, ".profile"), jc.DoesNotExist)
}