func (s *MySuite) TestImageList(c *C) { err := image.CreateCmd("test1", "user", "pwd", "url") c.Assert(err, IsNil) err = image.CreateCmd("test2", "user", "pwd", "url") c.Assert(err, IsNil) err = image.ListCmd() c.Assert(err, IsNil) }
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) }
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) }
func (s *MySuite) TestImageInspect(c *C) { err := image.CreateCmd("test", "user", "pwd", "url") c.Assert(err, IsNil) err = image.InspectCmd("test") c.Assert(err, IsNil) }