Ejemplo n.º 1
0
 def test_multi_data_2(self):
     api_caller = ApiCaller()
     country_list = ["Puerto Rico", "Sweden"]
     expected_response = {
         'Puerto Rico': {
             1960: None
         },
         'Sweden': {
             1960: 6.58
         }
     }
     self.assertEqual(
         expected_response,
         api_caller.get_multiple_data_range(country_list,
                                            'emissions_per_capita', 1940,
                                            1960))
Ejemplo n.º 2
0
 def test_multi_data_1(self):
     api_caller = ApiCaller()
     country_list = ["Aruba", "Finland"]
     expected_response = {
         'Aruba': {
             1985: None,
             1986: 179.683,
             1987: 447.374
         },
         'Finland': {
             1985: 49665.848,
             1986: 53329.181,
             1987: 57656.241
         }
     }
     self.assertEqual(
         expected_response,
         api_caller.get_multiple_data_range(country_list, 'emissions', 1985,
                                            1987))