def exists(self): response = HttpClient.get_response(self.yelp_url, self.request_components) return response.status_code == 200
def test_returns_404_for_invalid_url(self): key = {"key": settings.MEETUP_KEY} url = 'https://api.meetup.com/papers-we-HATE' args = {'params': key} response = HttpClient.get_response(url, args) self.assertEquals(404, response.status_code)
def test_returns_200_ok_from_valid_url(self): key = {"key": settings.MEETUP_KEY} url = 'https://api.meetup.com/papers-we-love' args = {'params': key} response = HttpClient.get_response(url, args) self.assertEquals(200, response.status_code)
def test_returns_404_for_invalid_url(self): auth = settings.YELP_OAUTH_OBJECT url = "https://api.yelp.com/v2/business/made-up-pizza-place" args = {'auth': auth} response = HttpClient.get_response(url, args) self.assertEquals(400, response.status_code)
def test_returns_200_ok_from_valid_url(self): auth = settings.YELP_OAUTH_OBJECT url = "https://api.yelp.com/v2/business/prince-st-pizza-new-york" args = {'auth': auth} response = HttpClient.get_response(url, args) self.assertEquals(200, response.status_code)