1
0
mirror of https://github.com/instaloader/instaloader.git synced 2024-10-03 22:07:11 +02:00

Add paging tests for profiles and stories

This commit is contained in:
Alexander Graf 2018-04-17 14:23:12 +02:00
parent dcd16f29c2
commit 9d8175354b

View File

@ -38,6 +38,12 @@ class TestInstaloaderAnonymously(unittest.TestCase):
self.L.download_profile(PUBLIC_PROFILE, profile_pic=False, fast_update=True)
self.L.download_profile(PUBLIC_PROFILE, profile_pic=False, fast_update=True)
def test_public_profile_paging(self):
for count, post in enumerate(instaloader.Profile.from_username(self.L.context, PUBLIC_PROFILE).get_posts()):
print(post)
if count == PAGING_MAX_COUNT:
break
def test_profile_pic_download(self):
self.L.download_profile(PUBLIC_PROFILE, profile_pic_only=True)
@ -69,6 +75,18 @@ class TestInstaloaderLoggedIn(TestInstaloaderAnonymously):
def test_private_profile_download(self):
self.L.download_profile(PRIVATE_PROFILE, download_stories=True)
def test_stories_paging(self):
for user_story in self.L.get_stories():
print("profile {}.".format(user_story.owner_username))
for item in user_story.get_items():
print(item)
def test_private_profile_paging(self):
for count, post in enumerate(instaloader.Profile.from_username(self.L.context, PRIVATE_PROFILE).get_posts()):
print(post)
if count == PAGING_MAX_COUNT:
break
def test_feed_download(self):
self.L.download_feed_posts(NORMAL_MAX_COUNT)