1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Merge branch 'master' into remote-api

This commit is contained in:
Victor Vieux 2013-05-07 21:02:32 +02:00
commit 32cbd72ebe
5 changed files with 38 additions and 7 deletions

View file

@ -118,7 +118,10 @@ func TestRuntimeCreate(t *testing.T) {
if len(runtime.List()) != 0 {
t.Errorf("Expected 0 containers, %v found", len(runtime.List()))
}
container, err := NewBuilder(runtime).Create(&Config{
builder := NewBuilder(runtime)
container, err := builder.Create(&Config{
Image: GetTestImage(runtime).Id,
Cmd: []string{"ls", "-al"},
},
@ -157,6 +160,26 @@ func TestRuntimeCreate(t *testing.T) {
if !runtime.Exists(container.Id) {
t.Errorf("Exists() returned false for a newly created container")
}
// Make sure crete with bad parameters returns an error
_, err = builder.Create(
&Config{
Image: GetTestImage(runtime).Id,
},
)
if err == nil {
t.Fatal("Builder.Create should throw an error when Cmd is missing")
}
_, err = builder.Create(
&Config{
Image: GetTestImage(runtime).Id,
Cmd: []string{},
},
)
if err == nil {
t.Fatal("Builder.Create should throw an error when Cmd is empty")
}
}
func TestDestroy(t *testing.T) {