From be6f2171fbfeb8a4fc6e8b6378ffee6ef5508bd2 Mon Sep 17 00:00:00 2001 From: Brad Rydzewski Date: Sun, 23 Mar 2014 23:42:33 -0700 Subject: [PATCH] updated exiting unit tests. placeholders for new ones --- pkg/build/build_test.go | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/pkg/build/build_test.go b/pkg/build/build_test.go index b7dcc9fa..a36484a2 100644 --- a/pkg/build/build_test.go +++ b/pkg/build/build_test.go @@ -108,12 +108,30 @@ func TestSetupEmptyImage(t *testing.T) { } } +// TestSetupErrorInspectImage will test our ability to handle a +// failure when inspecting an image (i.e. bradrydzewski/mysql:latest), +// which should trigger a `docker pull`. +func TestSetupErrorInspectImage(t *testing.T) { + t.Skip() +} + +// TestSetupErrorPullImage will test our ability to handle a +// failure when pulling an image (i.e. bradrydzewski/mysql:latest) +func TestSetupErrorPullImage(t *testing.T) { + t.Skip() +} + // TestSetupErrorRunDaemonPorts will test our ability to handle a // failure when starting a service (i.e. mysql) as a daemon. func TestSetupErrorRunDaemonPorts(t *testing.T) { setup() defer teardown() + mux.HandleFunc("/v1.9/images/bradrydzewski/mysql:5.5/json", func(w http.ResponseWriter, r *http.Request) { + data := []byte(`{"config": { "ExposedPorts": { "6379/tcp": {}}}}`) + w.Write(data) + }) + mux.HandleFunc("/v1.9/containers/create", func(w http.ResponseWriter, r *http.Request) { w.WriteHeader(http.StatusBadRequest) }) @@ -139,6 +157,11 @@ func TestSetupErrorServiceInspect(t *testing.T) { setup() defer teardown() + mux.HandleFunc("/v1.9/images/bradrydzewski/mysql:5.5/json", func(w http.ResponseWriter, r *http.Request) { + data := []byte(`{"config": { "ExposedPorts": { "6379/tcp": {}}}}`) + w.Write(data) + }) + mux.HandleFunc("/v1.9/containers/create", func(w http.ResponseWriter, r *http.Request) { body := `{ "Id":"e90e34656806", "Warnings":[] }` w.Write([]byte(body))