예제 #1
0
 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)
예제 #2
0
 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)
예제 #3
0
 def test_exceed_limit_data(self):
     with self.assertRaises(GeocoderRequestLimitExceed):
         GeonamesRequestSender.checkResponseForException(
             json.dumps(RESPONSE_FOR_LIMIT_EXCEED))
예제 #4
0
 def test_exceed_other_data(self):
     with self.assertRaises(GeocoderRequestOtherExceed):
         GeonamesRequestSender.checkResponseForException(
             json.dumps(RESPONSE_FOR_OTHER_EXCEED))
예제 #5
0
 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)
예제 #6
0
 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)