Skip to content

Commit

Permalink
test_instagram: add HTML_PROFILE_PRIVATE[_COMPLETE]
Browse files Browse the repository at this point in the history
  • Loading branch information
snarfed committed Apr 2, 2016
1 parent 3d96590 commit fcbf5e9
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions granary/test/test_instagram.py
Expand Up @@ -615,6 +615,8 @@ def tag_uri(name):
'external_url': 'https:\/\/snarfed.org',
}}]},
}
HTML_PROFILE_PRIVATE = copy.deepcopy(HTML_PROFILE)
HTML_PROFILE_PRIVATE['entry_data']['ProfilePage'][0]['user']['is_private'] = True

HTML_PHOTO_PAGE = { # eg https://www.instagram.com/p/ABC123/
'config': {
Expand Down Expand Up @@ -759,6 +761,7 @@ def tag_uri(name):

HTML_FEED_COMPLETE = HTML_HEADER + json.dumps(HTML_FEED) + HTML_FOOTER
HTML_PROFILE_COMPLETE = HTML_HEADER + json.dumps(HTML_PROFILE) + HTML_FOOTER
HTML_PROFILE_PRIVATE_COMPLETE = HTML_HEADER + json.dumps(HTML_PROFILE_PRIVATE) + HTML_FOOTER
HTML_PHOTO_COMPLETE = HTML_HEADER + json.dumps(HTML_PHOTO_PAGE) + HTML_FOOTER
HTML_VIDEO_COMPLETE = HTML_HEADER + json.dumps(HTML_VIDEO_PAGE) + HTML_FOOTER

Expand Down Expand Up @@ -1266,11 +1269,7 @@ def test_html_to_activities_profile(self):
self.assert_equals(HTML_VIEWER, viewer)

def test_html_to_activities_profile_private(self):
profile = copy.deepcopy(HTML_PROFILE)
profile['entry_data']['ProfilePage'][0]['user']['is_private'] = True

_, actor = self.instagram.html_to_activities(
HTML_HEADER + json.dumps(profile) + HTML_FOOTER)
_, actor = self.instagram.html_to_activities(HTML_PROFILE_PRIVATE_COMPLETE)
self.assert_equals([{'objectType':'group', 'alias':'@private'}], actor['to'])

def test_html_to_activities_photo(self):
Expand Down

0 comments on commit fcbf5e9

Please sign in to comment.