Skip to content

Commit 6d3ca80

Browse files
authored
Merge pull request #35 from kmaehashi/fix-get-tags-test
Improve `AtWikiAPI.get_tags` test
2 parents e20ee27 + eebfa32 commit 6d3ca80

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

atwiki/test/test_core.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,20 @@ def test_get_list_tag(self):
129129
assert len(pages) == 0
130130

131131
def test_get_tags(self):
132+
# Get the first tag from the first listing.
132133
song = next(self._api.get_tags('num'))
133134
assert song['name'] == '曲'
134135
assert 35000 < song['weight'] < 70000
135136

137+
# Get the first tag from the second listing.
136138
not_song = next(self._api.get_tags('num', _start=2))
137139
assert not_song['name'] != '曲'
140+
141+
# Ensure listing pagerize works. (retrieve 3 listing, 500 pages in each)
142+
count = 0
143+
for page in self._api.get_tags():
144+
count += 1
145+
if 500*3 <= count:
146+
break
147+
else:
148+
assert False, "unexpected number of tags"

0 commit comments

Comments
 (0)