MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_setfirstweekday

Method test_setfirstweekday

Lib/test/test_calendar.py:518–527  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

516 self.assertEqual(calendar.isleap(2003), 0)
517
518 def test_setfirstweekday(self):
519 self.assertRaises(TypeError, calendar.setfirstweekday, 'flabber')
520 self.assertRaises(ValueError, calendar.setfirstweekday, -1)
521 self.assertRaises(ValueError, calendar.setfirstweekday, 200)
522 orig = calendar.firstweekday()
523 calendar.setfirstweekday(calendar.SUNDAY)
524 self.assertEqual(calendar.firstweekday(), calendar.SUNDAY)
525 calendar.setfirstweekday(calendar.MONDAY)
526 self.assertEqual(calendar.firstweekday(), calendar.MONDAY)
527 calendar.setfirstweekday(orig)
528
529 def test_illegal_weekday_reported(self):
530 with self.assertRaisesRegex(calendar.IllegalWeekdayError, '123'):

Callers

nothing calls this directly

Calls 3

setfirstweekdayMethod · 0.80
assertRaisesMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected