コード例 #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)