Skip to content

Commit

Permalink
Fix unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
Robi9 committed Sep 11, 2023
1 parent 3f4a78a commit 6c4248d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion flows/routers/base_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
4 changes: 2 additions & 2 deletions flows/routers/testdata/smart.json
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 6c4248d

Please sign in to comment.