예제 #1
0
파일: environ_test.go 프로젝트: jkary/core
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)
}
예제 #2
0
// 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
}