Fix anonymous GraphQL queries

Port of 73ec884ea4 to v4-dev.
This commit is contained in:
Alexander Graf
2018-04-11 21:24:36 +02:00
parent 020830d591
commit 9b3014d5bf
5 changed files with 103 additions and 47 deletions

View File

@@ -82,12 +82,14 @@ class TestInstaloader(unittest.TestCase):
def test_get_followees(self):
self.L.load_session_from_file(OWN_USERNAME)
for f in self.L.get_followees(instaloader.Profile.from_username(self.L.context, OWN_USERNAME)):
profile = instaloader.Profile.from_username(self.L.context, OWN_USERNAME)
for f in profile.get_followees():
print(f['username'])
def test_get_followers(self):
self.L.load_session_from_file(OWN_USERNAME)
for f in self.L.get_followers(instaloader.Profile.from_username(self.L.context, OWN_USERNAME)):
profile = instaloader.Profile.from_username(self.L.context, OWN_USERNAME)
for f in profile.get_followers():
print(f['username'])
def test_get_username_by_id(self):
@@ -112,6 +114,13 @@ class TestInstaloader(unittest.TestCase):
self.assertEqual(post, post2)
break
def test_explore_paging(self):
self.L.load_session_from_file(OWN_USERNAME)
for count, post in enumerate(self.L.get_explore_posts()):
print(post)
if count == PAGING_MAX_COUNT:
break
if __name__ == '__main__':
unittest.main()