Explorar o código

client: test assertStatusCode

Brian Waldon %!s(int64=11) %!d(string=hai) anos
pai
achega
052521eaf1
Modificáronse 1 ficheiros con 10 adicións e 0 borrados
  1. 10 0
      client/members_test.go

+ 10 - 0
client/members_test.go

@@ -83,3 +83,13 @@ func TestMembersAPIActionRemove(t *testing.T) {
 		t.Error(err.Error())
 	}
 }
+
+func TestAssertStatusCode(t *testing.T) {
+	if err := assertStatusCode(400, 404); err == nil {
+		t.Errorf("assertStatusCode failed to detect conflict in 400 vs 404")
+	}
+
+	if err := assertStatusCode(400, 400); err != nil {
+		t.Errorf("assertStatusCode found conflict in 400 vs 400: %v", err)
+	}
+}