예제 #1
0
파일: test.py 프로젝트: RealTimeWeb/weather
 def test_newark(self):
     weatherservice._USE_CLASSES = False
     report = weatherservice.get_report("newark, de")
     self.assertIsInstance(report, dict)
예제 #2
0
파일: test.py 프로젝트: RealTimeWeb/weather
 def test_china(self):
     with self.assertRaises(weatherservice.GeocodeException):
         weatherservice.get_report("tokoyo, china")
예제 #3
0
파일: test.py 프로젝트: RealTimeWeb/weather
 def test_cache(self):
     weatherservice._start_editing()
     weatherservice.get_report("newark, de")
     weatherservice.get_report("blacksburg, va")
     weatherservice.get_report("new york, NY")
     weatherservice.get_report("santa barbara, CA")
     weatherservice.get_report("san francisco, CA")
     self.assertEqual(len(weatherservice._CACHE), 27)
     weatherservice.get_report("san francisco, CA")
     weatherservice.get_report("san francisco, CA")
     weatherservice.get_report("san francisco, CA")
     self.assertEqual(sum([len(element) for key, element in weatherservice._CACHE.items()]), 67)
예제 #4
0
 def test_newark(self):
     weatherservice._USE_CLASSES = False
     report = weatherservice.get_report("newark, de")
     self.assertIsInstance(report, dict)
예제 #5
0
 def test_china(self):
     with self.assertRaises(weatherservice.GeocodeException):
         weatherservice.get_report("tokoyo, china")
예제 #6
0
 def test_cache(self):
     weatherservice._start_editing()
     weatherservice.get_report("newark, de")
     weatherservice.get_report("blacksburg, va")
     weatherservice.get_report("new york, NY")
     weatherservice.get_report("santa barbara, CA")
     weatherservice.get_report("san francisco, CA")
     self.assertEqual(len(weatherservice._CACHE), 27)
     weatherservice.get_report("san francisco, CA")
     weatherservice.get_report("san francisco, CA")
     weatherservice.get_report("san francisco, CA")
     self.assertEqual(
         sum([
             len(element) for key, element in weatherservice._CACHE.items()
         ]), 67)