def get_expected_response(website, user, status): return { 'possible': True, 'status': status, 'url': username_api.get_profile_url(website, user), 'avatar': username_api.get_avatar(website, user) if status == 200 else None }
def test_format_checking(self, website, username): resp = self.app.get('/check/{w}/{u}'.format(w=website, u=username)) json_resp = json.loads(resp.get_data().decode()) url = username_api.get_profile_url(website, username) assert { 'possible': False, 'usable': True, 'url': url } == json_resp