Skip to content

Commit 8daa0b7

Browse files
author
Slipping-Jimmy
committed
Fix broken link issue in unit tests
Updated the test_parse_without_metalines test case to replace the previously invalid link, article ID, and board name with valid article data, resolving the KeyError caused by a 404 error.
1 parent f8c0407 commit 8daa0b7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

test.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ def test_parse_with_push_without_contents(self):
3939
self.assertEqual(jsondata['board'], self.board)
4040

4141
def test_parse_without_metalines(self):
42-
self.link = 'https://www.ptt.cc/bbs/NBA/M.1432438578.A.4B0.html'
43-
self.article_id = 'M.1432438578.A.4B0'
44-
self.board = 'NBA'
42+
self.link = 'https://www.ptt.cc/bbs/MacShop/M.1710908255.A.871.html'
43+
self.article_id = 'M.1710908255.A.871'
44+
self.board = 'MacShop'
4545

4646
jsondata = json.loads(crawler.parse(self.link, self.article_id, self.board))
4747
self.assertEqual(jsondata['article_id'], self.article_id)

0 commit comments

Comments
 (0)