Python源码示例:calendar.IllegalMonthError()
示例1
def test_zeroth_month(self):
# Tests low invalid boundary case.
with self.assertRaises(calendar.IllegalMonthError):
calendar.monthrange(2004, 0)
示例2
def test_thirteenth_month(self):
# Tests high invalid boundary case.
with self.assertRaises(calendar.IllegalMonthError):
calendar.monthrange(2004, 13)
示例3
def test_zeroth_month(self):
# Tests low invalid boundary case.
with self.assertRaises(calendar.IllegalMonthError):
calendar.monthrange(2004, 0)
示例4
def test_thirteenth_month(self):
# Tests high invalid boundary case.
with self.assertRaises(calendar.IllegalMonthError):
calendar.monthrange(2004, 13)
示例5
def test_zeroth_month(self):
# Tests low invalid boundary case.
with self.assertRaises(calendar.IllegalMonthError):
calendar.monthrange(2004, 0)
示例6
def test_thirteenth_month(self):
# Tests high invalid boundary case.
with self.assertRaises(calendar.IllegalMonthError):
calendar.monthrange(2004, 13)
示例7
def test_zeroth_month(self):
# Tests low invalid boundary case.
with self.assertRaises(calendar.IllegalMonthError):
calendar.monthrange(2004, 0)
示例8
def test_thirteenth_month(self):
# Tests high invalid boundary case.
with self.assertRaises(calendar.IllegalMonthError):
calendar.monthrange(2004, 13)
示例9
def test_illegal_month_reported(self):
with self.assertRaisesRegex(calendar.IllegalMonthError, '65'):
calendar.monthrange(2004, 65)
示例10
def test_zeroth_month(self):
# Tests low invalid boundary case.
with self.assertRaises(calendar.IllegalMonthError):
calendar.monthrange(2004, 0)
示例11
def test_thirteenth_month(self):
# Tests high invalid boundary case.
with self.assertRaises(calendar.IllegalMonthError):
calendar.monthrange(2004, 13)
示例12
def test_illegal_month_reported(self):
with self.assertRaisesRegex(calendar.IllegalMonthError, '65'):
calendar.monthrange(2004, 65)
示例13
def test_zeroth_month(self):
# Tests low invalid boundary case.
with self.assertRaises(calendar.IllegalMonthError):
calendar.monthrange(2004, 0)
示例14
def test_thirteenth_month(self):
# Tests high invalid boundary case.
with self.assertRaises(calendar.IllegalMonthError):
calendar.monthrange(2004, 13)
示例15
def test_zeroth_month(self):
# Tests low invalid boundary case.
with self.assertRaises(calendar.IllegalMonthError):
calendar.monthrange(2004, 0)
示例16
def test_thirteenth_month(self):
# Tests high invalid boundary case.
with self.assertRaises(calendar.IllegalMonthError):
calendar.monthrange(2004, 13)
示例17
def test_illegal_month_reported(self):
with self.assertRaisesRegex(calendar.IllegalMonthError, '65'):
calendar.monthrange(2004, 65)
示例18
def test_zeroth_month(self):
# Tests low invalid boundary case.
with self.assertRaises(calendar.IllegalMonthError):
calendar.monthrange(2004, 0)
示例19
def test_thirteenth_month(self):
# Tests high invalid boundary case.
with self.assertRaises(calendar.IllegalMonthError):
calendar.monthrange(2004, 13)
示例20
def test_zeroth_month(self):
# Tests low invalid boundary case.
with self.assertRaises(calendar.IllegalMonthError):
calendar.monthrange(2004, 0)
示例21
def test_thirteenth_month(self):
# Tests high invalid boundary case.
with self.assertRaises(calendar.IllegalMonthError):
calendar.monthrange(2004, 13)