Explorar el Código

Added TestGETNoServer

Piotr Czajkowski hace 4 años
padre
commit
8dec70b522
Se han modificado 1 ficheros con 11 adiciones y 0 borrados
  1. 11 0
      rest_test.go

+ 11 - 0
rest_test.go

@@ -107,3 +107,14 @@ func TestGET404(t *testing.T) {
 		t.Errorf("Wrong result, %v", resultString)
 	}
 }
+
+func TestGETNoServer(t *testing.T) {
+	data, err := GET("/")
+	if data != nil {
+		t.Error("Data should be nil!")
+	}
+
+	if err == nil {
+		t.Error("There should be an error!")
+	}
+}