updated exiting unit tests. placeholders for new ones

This commit is contained in:
Brad Rydzewski 2014-03-23 23:42:33 -07:00
parent d498f18881
commit be6f2171fb

View file

@ -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 // TestSetupErrorRunDaemonPorts will test our ability to handle a
// failure when starting a service (i.e. mysql) as a daemon. // failure when starting a service (i.e. mysql) as a daemon.
func TestSetupErrorRunDaemonPorts(t *testing.T) { func TestSetupErrorRunDaemonPorts(t *testing.T) {
setup() setup()
defer teardown() 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) { mux.HandleFunc("/v1.9/containers/create", func(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusBadRequest) w.WriteHeader(http.StatusBadRequest)
}) })
@ -139,6 +157,11 @@ func TestSetupErrorServiceInspect(t *testing.T) {
setup() setup()
defer teardown() 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) { mux.HandleFunc("/v1.9/containers/create", func(w http.ResponseWriter, r *http.Request) {
body := `{ "Id":"e90e34656806", "Warnings":[] }` body := `{ "Id":"e90e34656806", "Warnings":[] }`
w.Write([]byte(body)) w.Write([]byte(body))