From 4d6921d007ff05b89e33c09a1265db23372cd6ac Mon Sep 17 00:00:00 2001 From: Rustem Kamalov Date: Tue, 11 Jul 2023 18:53:42 +0300 Subject: [PATCH] Baidu [ImageUrlBuild] test fix --- baidu/all_test.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/baidu/all_test.go b/baidu/all_test.go index bc9dc56..4052df9 100644 --- a/baidu/all_test.go +++ b/baidu/all_test.go @@ -43,17 +43,17 @@ func TestSearch(t *testing.T) { } func TestImageUrlBuild(t *testing.T) { - query := core.Query{Text: "金毛猎犬", Limit: 10} + query := core.Query{Text: "金毛猎犬"} - res, err := BuildImageURL(query, 0) + got, err := BuildImageURL(query, 0) if err != nil { t.Fatal(err) } - want := "https://image.baidu.com/search/acjson?cl=2&ie=utf-8&ipn=r&tn=resultjson_com&word=%E9%87%91%E6%AF%9B%E7%8C%8E%E7%8A%AC" + want := "https://image.baidu.com/search/acjson?cl=2&fp=result&ie=utf-8&ipn=rj&oe=utf-8&pn=0&rn=30&tn=resultjson_com&word=%E9%87%91%E6%AF%9B%E7%8C%8E%E7%8A%AC" - if want != res { - t.Fatalf("Wanted result `%s` doesn't match to resulted `%s`", want, res) + if want != got { + t.Fatalf("Want: `%s`, Got `%s`", want, got) } }