func (s *fakeHomeSuite) TestFakeHomeSetsUpHome(c *gc.C) { sshDir := testing.HomePath(".ssh") _, err := os.Stat(sshDir) c.Assert(err, gc.IsNil) jujuDir := testing.HomePath(".juju") _, err = os.Stat(jujuDir) c.Assert(err, gc.IsNil) envFile := testing.HomePath(".juju", "environments.yaml") _, err = os.Stat(envFile) c.Assert(err, gc.IsNil) }
// resetJujuHome restores an new, clean Juju home environment without tools. func resetJujuHome(c *gc.C) environs.Environ { jenvDir := coretesting.HomePath(".juju", "environments") err := os.RemoveAll(jenvDir) c.Assert(err, gc.IsNil) coretesting.WriteEnvironments(c, envConfig) dummy.Reset() store, err := configstore.Default() c.Assert(err, gc.IsNil) env, err := environs.PrepareFromName("peckham", nullContext(c), store) c.Assert(err, gc.IsNil) envtesting.RemoveAllTools(c, env) return env }