コード例 #1
0
 def test_51_add_days_fail(self):
     pi = PaperInfo('Paper', '6')
     with self.assertRaises(ValueError) as e:
         pi.add_days('9')
     self.assertEqual(e.exception.args[0],
                      'Day sequence contains no valid days')
コード例 #2
0
 def test_52_add_days_fail(self):
     pi = PaperInfo('Paper', '6')
     pi.add_days('7')
     self.assertEqual(pi.days, {6, 7})
コード例 #3
0
 def test_01_add_days(self):
     pi = PaperInfo('Paper', '6')  # Add a paper delivered on Saturday
     pi.add_days('5')  # Add a paer to be delivered on Friday
     self.assertEqual(pi.days, {5, 6})