Example #1
0
 def test_year_range_4(self):
     api_caller = ApiCaller()
     year_range = [
         1960, 1961, 1962, 1963, 1964, 1965, 1966, 1967, 1968, 1969, 1970
     ]
     api_caller.get_year_list('Philippines', 'emissions', 1000, 1970)
     self.assertEqual(
         year_range,
         api_caller.get_year_list('Philippines', 'emissions', 1000, 1970))
Example #2
0
 def test_year_range_3(self):
     api_caller = ApiCaller()
     year_range = [1986, 1987, 1988]
     self.assertEqual(
         year_range,
         api_caller.get_year_list('Aruba', 'emissions_per_capita', 1900,
                                  1988))
Example #3
0
 def test_year_range_9(self):
     api_caller = ApiCaller()
     with self.assertRaises(TypeError):
         api_caller.get_year_list('Portugal', 'population', 1967, 'asd')
Example #4
0
 def test_year_range_7(self):
     api_caller = ApiCaller()
     with self.assertRaises(ValueError):
         api_caller.get_year_list('Portugal', 'asd', 1967, 1970)
Example #5
0
 def test_year_range_6(self):
     api_caller = ApiCaller()
     with self.assertRaises(TypeError):
         api_caller.get_year_list('Portugal', 2, 1967, 1970)
Example #6
0
 def test_year_range_5(self):
     api_caller = ApiCaller()
     year_range = []
     self.assertEqual(
         year_range,
         api_caller.get_year_list('Portugal', 'population', 1900, 1923))
Example #7
0
 def test_year_range_2(self):
     api_caller = ApiCaller()
     year_range = [2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017]
     self.assertEqual(
         year_range,
         api_caller.get_year_list('Indonesia', 'population', 2010, 3000))
Example #8
0
 def test_year_range_1(self):
     api_caller = ApiCaller()
     year_range = [2003, 2004, 2005]
     self.assertEqual(
         year_range,
         api_caller.get_year_list('Zimbabwe', 'emissions', 2005, 2003))