def test_bad_for_name_by_year(self): employees = Employees(self.TEST_FILE) self.assertIsNotNone(employees) self.assertIsNone(employees.get_for_name_by_year('frank', 1999)) self.assertIsNone(employees.get_for_name_by_year('jo', 1999)) self.assertIsNone(employees.get_for_name_by_year('badname', 2011)) self.assertIsNone(employees.get_for_name_by_year('badname', 2012)) self.assertIsNone(employees.get_for_name_by_year('badname', 2013)) self.assertIsNone(employees.get_for_name_by_year('badname', 2014))
def test_for_name_by_year(self): employees = Employees(self.TEST_FILE) self.assertIsNotNone(employees) self.assertEqual( 100000, employees.get_for_name_by_year(name='frank', year=2011)) self.assertEqual( 140000, employees.get_for_name_by_year(name='frank', year=2012)) self.assertEqual( 200000, employees.get_for_name_by_year(name='frank', year=2013)) self.assertEqual(130000, employees.get_for_name_by_year(name='jo', year=2012)) self.assertEqual(220000, employees.get_for_name_by_year(name='jo', year=2013)) self.assertEqual(210000, employees.get_for_name_by_year(name='jo', year=2014))