def expect_instagram_fetch(self, body=test_instagram.HTML_PROFILE_COMPLETE, **kwargs): TestCase.expect_requests_get(self, gr_instagram.HTML_BASE_URL + 'snarfed/', body, allow_redirects=False, **kwargs)
def expect_site_fetch(self, body=None): if body is None: body = """ <html><body> <a rel="me" href="https://www.instagram.com/snarfed">me on insta</a> </body></html> """ TestCase.expect_requests_get(self, 'http://snarfed.org', body)
def expect_indieauth_check(self, state=''): TestCase.expect_requests_post( self, indieauth.INDIEAUTH_URL, 'me=http://snarfed.org', data={ 'me': 'http://snarfed.org', 'state': state, 'code': 'my_code', 'client_id': appengine_config.INDIEAUTH_CLIENT_ID, 'redirect_uri': 'http://localhost/instagram/callback', })
def expect_indieauth_check(self): return TestCase.expect_requests_post( self, indieauth.INDIEAUTH_URL, 'me=http://snarfed.org', data={ 'me': 'http://snarfed.org', 'state': 'towkin', 'code': 'my_code', 'client_id': indieauth.INDIEAUTH_CLIENT_ID, 'redirect_uri': 'http://localhost/indieauth/callback', })
def expect_instagram_fetch(self, user=PROFILE_USER, **kwargs): html = '' if user: profile = copy.deepcopy(gr_test_instagram.HTML_PROFILE) instagram_profile_user(profile).clear() instagram_profile_user(profile).update(user) html = (gr_test_instagram.HTML_HEADER + json_dumps(profile) + gr_test_instagram.HTML_FOOTER) return TestCase.expect_requests_get(self, gr_instagram.HTML_BASE_URL + 'snarfed/', html, allow_redirects=False, **kwargs)
def expect_instagram_fetch(self, body=test_instagram.HTML_PROFILE_COMPLETE, **kwargs): TestCase.expect_requests_get(self, 'https://www.instagram.com/snarfed/', body, allow_redirects=False, **kwargs)