def testThirdQuarterJuly(self): """createpriordaysmaster should produce the right days for a quartly test """ result = snapintime.createpriordaysmaster("7","9","quarterly") self.assertEqual((['4','5','6'],[]),result)
def testWeeklyEarlyinMonthAug(self): """createpriordaysmaster should produce the right days for a weekly test if it has to go to the previous month""" result = snapintime.createpriordaysmaster("8","9","weekly") self.assertEqual((['7','8'],[[27,28,29,30,31],[1,2]]),result)
def testSecondQuarterJune(self): """createpriordaysmaster should produce the right days for a quartly test """ result = snapintime.createpriordaysmaster("6","9","quarterly") self.assertEqual((['1','2','3'],[]),result)
def testDaily(self): """createpriordaysmaster should produce the right days for a daily test in the middle of the month""" result = snapintime.createpriordaysmaster("1","14","daily") self.assertEqual(('1',[12]),result)
def testWeeklyEarlyinMonthMarch(self): """createpriordaysmaster should produce the right days for a weekly test if it has to go to the previous month""" result = snapintime.createpriordaysmaster("3","9","weekly") self.assertEqual((['2','3'],[[24,25,26,27,28],[1,2]]),result)
def testWeeklyEarlyinMonthFeb4(self): """createpriordaysmaster should produce the right days for a weekly test if it has to go to the previous month.""" result = snapintime.createpriordaysmaster("2","6","weekly") self.assertEqual((['1','2'],[[24,25,26,27,28,29,30],[]]),result)
def testWeeklyEarliestinMonthFeb(self): """createpriordaysmaster should produce the right days for a weekly test if it has to go to the previous month, even if it's day 1""" result = snapintime.createpriordaysmaster("2","1","weekly") self.assertEqual((['1','2'],[[19,20,21,22,23,24,25],[]]),result)
def testWeeklyEarlyinMonthFeb2(self): """createpriordaysmaster should produce the right days for a weekly test if it has to go to the previous month.""" result = snapintime.createpriordaysmaster("2","12","weekly") self.assertEqual((['1','2'],[[30,31],[1,2,3,4,5]]),result)
def testWeekly2(self): """createpriordaysmaster should produce the right days for a weekly test - 7 days later""" result = snapintime.createpriordaysmaster("1","21","weekly") self.assertEqual((['1'],[8,9,10,11,12,13,14]),result)
def testWeekly(self): """createpriordaysmaster should produce the right days for a weekly test""" result = snapintime.createpriordaysmaster("1","14","weekly") self.assertEqual((['1'],[1,2,3,4,5,6,7]),result)
def testDailyMonthDay2Feb(self): """createpriordaysmaster should produce the right days for a daily test first of the month""" result = snapintime.createpriordaysmaster("2","2","daily") self.assertEqual(('1',[31]),result)
def testFourthQuarterDecember(self): """createpriordaysmaster should produce the right days for a quartly test """ result = snapintime.createpriordaysmaster("12","9","quarterly") self.assertEqual((['7','8','9'],[]),result)