def test_nth_weekday(self): ''' The 4th Thursday of Mar, 1998 was Mar 26th, 1998. see http://www.cpearson.com/excel/DateTimeWS.htm ''' date1 = nth_weekday(4, Thursday, Mar, 1998) expected_date = Date(26, Mar, 1998) self.assertTrue(expected_date == date1)
def test_nth_weekday_invalid_month(self): with self.assertRaises(RuntimeError): nth_weekday(4, Thursday, 0, 2000)