From 67a6b75987dfd2983bd17e1e5e99c91e2df5fc30 Mon Sep 17 00:00:00 2001 From: nick Date: Fri, 2 Feb 2024 14:52:13 +0700 Subject: [PATCH] Removed unnecessary tests --- test/api_search_test.go | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/test/api_search_test.go b/test/api_search_test.go index 9e1cee6..18be91a 100755 --- a/test/api_search_test.go +++ b/test/api_search_test.go @@ -122,11 +122,7 @@ func Test_openapi_SearchAPIService(t *testing.T) { } apiClient.UtilsAPI.Sql(context.Background()).Body("DROP TABLE IF EXISTS movies").Execute() - resp, httpRes, err := apiClient.UtilsAPI.Sql(context.Background()).Body("CREATE TABLE movies (title text, plot text, release_year integer, rating float, code multi)").Execute() - fmt.Printf("test %+v\n", httpRes) - require.Nil(t, err) - require.NotNil(t, resp) - + apiClient.UtilsAPI.Sql(context.Background()).Body("CREATE TABLE movies (title text, plot text, release_year integer, rating float, code multi)").Execute() docs := [4]string { "{\"insert\": {\"index\" : \"movies\", \"id\" : 1, \"doc\" : {\"title\" : \"Star Trek 2: Nemesis\", \"plot\": \"The Enterprise is diverted to the Romulan homeworld Romulus, supposedly because they want to negotiate a peace treaty. Captain Picard and his crew discover a serious threat to the Federation once Praetor Shinzon plans to attack Earth.\", \"release_year\": 2002, \"rating\": 6.4, \"code\": [1,2,3]}}}", @@ -134,10 +130,7 @@ func Test_openapi_SearchAPIService(t *testing.T) { "{\"insert\": {\"index\" : \"movies\", \"id\" : 3, \"doc\" : {\"title\" : \"Star Trek 3: Nemesis\", \"plot\": \"The Enterprise is diverted to the Romulan homeworld Romulus, supposedly because they want to negotiate a peace treaty. Captain Picard and his crew discover a serious threat to the Federation once Praetor Shinzon plans to attack Earth.\", \"release_year\": 2003, \"rating\": 6.6, \"code\": [11,2,3]}}}", "{\"insert\": {\"index\" : \"movies\", \"id\" : 4, \"doc\" : {\"title\" : \"Star Trek 4: Nemesis\", \"plot\": \"The Enterprise is diverted to the Romulan homeworld Romulus, supposedly because they want to negotiate a peace treaty. Captain Picard and his crew discover a serious threat to the Federation once Praetor Shinzon plans to attack Earth.\", \"release_year\": 2003, \"rating\": 6, \"code\": [1,2,4]}}}", } - bulkResp, httpRes, err := apiClient.IndexAPI.Bulk(context.Background()).Body(strings.Join(docs[:], "\n")).Execute() - fmt.Printf("test %+v\n", httpRes) - require.Nil(t, err) - require.NotNil(t, bulkResp) + apiClient.IndexAPI.Bulk(context.Background()).Body(strings.Join(docs[:], "\n")).Execute() search := apiClient.SearchAPI.Search(context.Background()) searchRequest := openapiclient.NewSearchRequest("movies")