Пример #1
0
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)
}
Пример #2
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)
}
Пример #3
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)
}
Пример #4
0
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)
}