From 6c4248d7428b3ea273993b7929688e8147773561 Mon Sep 17 00:00:00 2001 From: Robi9 Date: Mon, 11 Sep 2023 17:41:42 -0300 Subject: [PATCH] Fix unit test --- flows/routers/base_test.go | 2 +- flows/routers/testdata/smart.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/flows/routers/base_test.go b/flows/routers/base_test.go index 824b87d37..bd02d7c00 100644 --- a/flows/routers/base_test.go +++ b/flows/routers/base_test.go @@ -81,7 +81,7 @@ func testRouterType(t *testing.T, assetsJSON json.RawMessage, typeName string) { routers.SetToken("token") httpx.SetRequestor(httpx.NewMockRequestor(map[string][]httpx.MockResponse{ "https://api.bothub.it/v2/repository/nlp/zeroshot/zeroshot-fast-predict": { - httpx.NewMockResponse(200, nil, `{"text":"Price"}`)}})) + httpx.NewMockResponse(200, nil, `{"output":"Price","other":false}`)}})) testName := fmt.Sprintf("test '%s' for router type '%s'", tc.Description, typeName) diff --git a/flows/routers/testdata/smart.json b/flows/routers/testdata/smart.json index 2ec964d36..da81e456e 100644 --- a/flows/routers/testdata/smart.json +++ b/flows/routers/testdata/smart.json @@ -59,8 +59,8 @@ "created_on": "2018-10-18T14:20:30.000123456Z", "elapsed_ms": 0, "extraction": "valid", - "request": "POST /v2/repository/nlp/zeroshot/zeroshot-fast-predict HTTP/1.1\r\nHost: api.bothub.it\r\nUser-Agent: Go-http-client/1.1\r\nContent-Length: 169\r\nAccept-Encoding: gzip\r\n\r\n{\"text\":\"How much does it cost?\",\"categories\":[{\"option\":\"Price\",\"synonyms\":[\"price\",\"photos\"]},{\"option\":\"Delivery\",\"synonyms\":[\"delivery\",\"address\"]}],\"token\":\"token\"}", - "response": "HTTP/1.0 200 OK\r\nContent-Length: 16\r\n\r\n{\"text\":\"Price\"}", + "request": "POST /v2/repository/nlp/zeroshot/zeroshot-fast-predict HTTP/1.1\r\nHost: api.bothub.it\r\nUser-Agent: Go-http-client/1.1\r\nContent-Length: 169\r\nContent-Type: application/json\r\nAccept-Encoding: gzip\r\n\r\n{\"text\":\"How much does it cost?\",\"categories\":[{\"option\":\"Price\",\"synonyms\":[\"price\",\"photos\"]},{\"option\":\"Delivery\",\"synonyms\":[\"delivery\",\"address\"]}],\"token\":\"token\"}", + "response": "HTTP/1.0 200 OK\r\nContent-Length: 32\r\n\r\n{\"output\":\"Price\",\"other\":false}", "retries": 0, "status": "success", "status_code": 200,