def test_zeroth_month(self):
# Tests low invalid boundary case.
with self.assertRaises(calendar.IllegalMonthError):
calendar.monthrange(2004, 0)
python类IllegalMonthError()的实例源码
def test_thirteenth_month(self):
# Tests high invalid boundary case.
with self.assertRaises(calendar.IllegalMonthError):
calendar.monthrange(2004, 13)
def test_zeroth_month(self):
# Tests low invalid boundary case.
with self.assertRaises(calendar.IllegalMonthError):
calendar.monthrange(2004, 0)
def test_thirteenth_month(self):
# Tests high invalid boundary case.
with self.assertRaises(calendar.IllegalMonthError):
calendar.monthrange(2004, 13)
def test_zeroth_month(self):
# Tests low invalid boundary case.
with self.assertRaises(calendar.IllegalMonthError):
calendar.monthrange(2004, 0)
def test_thirteenth_month(self):
# Tests high invalid boundary case.
with self.assertRaises(calendar.IllegalMonthError):
calendar.monthrange(2004, 13)
def test_zeroth_month(self):
# Tests low invalid boundary case.
with self.assertRaises(calendar.IllegalMonthError):
calendar.monthrange(2004, 0)
def test_thirteenth_month(self):
# Tests high invalid boundary case.
with self.assertRaises(calendar.IllegalMonthError):
calendar.monthrange(2004, 13)
def test_illegal_month_reported(self):
with self.assertRaisesRegex(calendar.IllegalMonthError, '65'):
calendar.monthrange(2004, 65)
def test_zeroth_month(self):
# Tests low invalid boundary case.
with self.assertRaises(calendar.IllegalMonthError):
calendar.monthrange(2004, 0)
def test_thirteenth_month(self):
# Tests high invalid boundary case.
with self.assertRaises(calendar.IllegalMonthError):
calendar.monthrange(2004, 13)
def test_zeroth_month(self):
# Tests low invalid boundary case.
with self.assertRaises(calendar.IllegalMonthError):
calendar.monthrange(2004, 0)
def test_thirteenth_month(self):
# Tests high invalid boundary case.
with self.assertRaises(calendar.IllegalMonthError):
calendar.monthrange(2004, 13)
def test_illegal_month_reported(self):
with self.assertRaisesRegex(calendar.IllegalMonthError, '65'):
calendar.monthrange(2004, 65)
def test_zeroth_month(self):
# Tests low invalid boundary case.
with self.assertRaises(calendar.IllegalMonthError):
calendar.monthrange(2004, 0)
def test_thirteenth_month(self):
# Tests high invalid boundary case.
with self.assertRaises(calendar.IllegalMonthError):
calendar.monthrange(2004, 13)
def test_zeroth_month(self):
# Tests low invalid boundary case.
with self.assertRaises(calendar.IllegalMonthError):
calendar.monthrange(2004, 0)
def test_thirteenth_month(self):
# Tests high invalid boundary case.
with self.assertRaises(calendar.IllegalMonthError):
calendar.monthrange(2004, 13)
def test_illegal_month_reported(self):
with self.assertRaisesRegex(calendar.IllegalMonthError, '65'):
calendar.monthrange(2004, 65)