Exemple #1
0
func (s *MySuite) TestImageCreate(c *C) {
	err := image.CreateCmd("test", "user", "pwd", "url")
	c.Assert(err, IsNil)
	data, _ := ioutil.ReadFile(image.FilePath("test"))
	c.Assert(string(data), Equals, "name: test\nuser: user\npwd: pwd\nurl: url\n")
	err = image.CreateCmd("test", "user", "pwd", "url")
	c.Assert(err, NotNil)
}
Exemple #2
0
func (s *MySuite) TestImageRemove(c *C) {
	err := image.CreateCmd("test", "user", "pwd", "url")
	c.Assert(err, IsNil)
	err = image.RemoveCmd("test")
	c.Assert(err, IsNil)
	filePath := image.FilePath("test")
	_, err = os.Stat(filePath)
	c.Assert(err, NotNil)
	err = image.RemoveCmd("test")
	c.Assert(err, NotNil)
}