예제 #1
0
 def test_merge_by_year_type(self):
     with self.assertRaises(KeyError) as mby:
         merge_by_year(countries, income, 'A')
         mby.exception
         self.assertEquals(str(mby.exception), 'Invalid input type.')
예제 #2
0
 def test_merge_by_year_value(self):
     with self.assertRaises(KeyError) as mby:
         merge_by_year(countries, income, '1700')
         mby.exception
         self.assertEquals(str(mby.exception), 'Invalid year.')