Exemplo n.º 1
0
 def test_data_8(self):
     api_caller = ApiCaller()
     with self.assertRaises(ValueError):
         api_caller.get_data('Norway', 'notData', 2009)
Exemplo n.º 2
0
 def test_data_9(self):
     api_caller = ApiCaller()
     with self.assertRaises(KeyError):
         api_caller.get_data('Canada', 'emissions', 1000)
Exemplo n.º 3
0
 def test_data_6(self):
     api_caller = ApiCaller()
     with self.assertRaises(TypeError):
         api_caller.get_data('Sweden', 'emissions', True)
Exemplo n.º 4
0
 def test_data_7(self):
     api_caller = ApiCaller()
     with self.assertRaises(KeyError):
         api_caller.get_data('NotACountry', 'emissions', 2009)
Exemplo n.º 5
0
 def test_data_5(self):
     api_caller = ApiCaller()
     with self.assertRaises(TypeError):
         api_caller.get_data('Belarus', True, 2009)
Exemplo n.º 6
0
 def test_data_4(self):
     api_caller = ApiCaller()
     with self.assertRaises(TypeError):
         api_caller.get_data(True, 'emissions', 2009)
Exemplo n.º 7
0
 def test_data_3(self):
     api_caller = ApiCaller()
     self.assertEqual(
         0.369,
         api_caller.get_data('Costa Rica', 'emissions_per_capita', 1960))
Exemplo n.º 8
0
 def test_data_2(self):
     api_caller = ApiCaller()
     self.assertEqual(58162.287,
                      api_caller.get_data('Norway', 'emissions', 2013))
Exemplo n.º 9
0
 def test_data_1(self):
     api_caller = ApiCaller()
     self.assertEqual(9378126,
                      api_caller.get_data('Sweden', 'population', 2010))