diff --git a/tests/sample_search.html b/tests/sample_search.html new file mode 100644 index 0000000..119e308 --- /dev/null +++ b/tests/sample_search.html @@ -0,0 +1,474 @@ + + + + + + + + +abc,搜索结果页 + + + + + + + + + + +
+
+
+

+ + 捐助我们 + 客户端下载 + +
+
+ +
+
+

网站公告:

+
    +
    +
    + + + + + + + + + + + + + + +
    + +
    +
    +
    +
    +
    + 查看:全部(141)影视(4)字幕(5)资讯(132) +
    +
    + + + + +
    +
    +
    +
    +
    + + + + + + + + +
    +
    +
    +
    + +
    + +
    + + + +
    + + + + + + + + + + + + + + +
    +
    人人影视在线聊天室
    +
    +

    人在线
    一起来热聊

    +
    +
    + + + + \ No newline at end of file diff --git a/tests/test_fansub.py b/tests/test_fansub.py index 281ba0d..c2099c0 100644 --- a/tests/test_fansub.py +++ b/tests/test_fansub.py @@ -64,7 +64,8 @@ class YYeTsTest(unittest.TestCase): @requests_mock.mock() def test_get_search_html(self, m): - html = "a response" + with open("sample_search.html") as f: + html = f.read() m.get('http://www.rrys2020.com/search?keyword=abc&type=resource', text=html) response = self.ins.__get_search_html__("abc") self.assertEqual(html, response)