Skip to content

Commit

Permalink
Merge pull request #35 from kmaehashi/fix-get-tags-test
Browse files Browse the repository at this point in the history
Improve `AtWikiAPI.get_tags` test
  • Loading branch information
kmaehashi authored Sep 19, 2022
2 parents e20ee27 + eebfa32 commit 6d3ca80
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions atwiki/test/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,20 @@ def test_get_list_tag(self):
assert len(pages) == 0

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

# Get the first tag from the second listing.
not_song = next(self._api.get_tags('num', _start=2))
assert not_song['name'] != '曲'

# Ensure listing pagerize works. (retrieve 3 listing, 500 pages in each)
count = 0
for page in self._api.get_tags():
count += 1
if 500*3 <= count:
break
else:
assert False, "unexpected number of tags"

0 comments on commit 6d3ca80

Please sign in to comment.