def test_exceed_limit_week_period(self): try: GeonamesRequestSender.checkResponseForException( json.dumps(RESPONSE_FOR_LIMIT_EXCEED_WEEK)) except GeocoderRequestLimitExceed as e: self.assertEqual(WEEK_PERIOD, e.lenght_to_period) self.assertEqual(e.getReturnObject(), WEEK_ERROR_MESSAGE)
def test_exceed_limit_week_period(self): try: GeonamesRequestSender.checkResponseForException( json.dumps(RESPONSE_FOR_LIMIT_EXCEED_WEEK)) except GeocoderRequestLimitExceed as e: self.assertEqual(WEEK_PERIOD, e.lenght_to_period) self.assertEqual(e.getReturnObject(), WEEK_ERROR_MESSAGE)
def test_exceed_limit_data(self): with self.assertRaises(GeocoderRequestLimitExceed): GeonamesRequestSender.checkResponseForException( json.dumps(RESPONSE_FOR_LIMIT_EXCEED))
def test_exceed_other_data(self): with self.assertRaises(GeocoderRequestOtherExceed): GeonamesRequestSender.checkResponseForException( json.dumps(RESPONSE_FOR_OTHER_EXCEED))
def test_exceed_other(self): try: GeonamesRequestSender.checkResponseForException( json.dumps(RESPONSE_FOR_OTHER_ERROR)) except GeocoderRequestOtherExceed as e: self.assertEqual(e.getReturnObject(), OTHER_ERROR_MESSAGE)
def test_exceed_other(self): try: GeonamesRequestSender.checkResponseForException( json.dumps(RESPONSE_FOR_OTHER_ERROR)) except GeocoderRequestOtherExceed as e: self.assertEqual(e.getReturnObject(), OTHER_ERROR_MESSAGE)