From 5a67f93eae5a3f6d08af4f2d9015ace86d4cb550 Mon Sep 17 00:00:00 2001 From: jmorganca Date: Sun, 25 Aug 2024 12:45:51 -0700 Subject: [PATCH] fix tests --- openai/openai_test.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/openai/openai_test.go b/openai/openai_test.go index 702c16c5..3bb55022 100644 --- a/openai/openai_test.go +++ b/openai/openai_test.go @@ -6,7 +6,6 @@ import ( "io" "net/http" "net/http/httptest" - "reflect" "strings" "testing" "time" @@ -497,7 +496,7 @@ func TestRetrieveMiddleware(t *testing.T) { "code": null, "message": "model not found", "param": null, - "type": "api_error" + "type": "invalid_request_error" } }`, }, @@ -525,8 +524,8 @@ func TestRetrieveMiddleware(t *testing.T) { t.Fatalf("failed to unmarshal actual response: %v", err) } - if !reflect.DeepEqual(expected, actual) { - t.Errorf("responses did not match\nExpected: %+v\nActual: %+v", expected, actual) + if diff := cmp.Diff(expected, actual); diff != "" { + t.Errorf("responses did not match (-want +got):\n%s", diff) } } }