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

Method test_timetuple

Lib/test/datetimetester.py:1693–1716  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1691 self.assertEqual(self.theclass.max - big, self.theclass.min)
1692
1693 def test_timetuple(self):
1694 for i in range(7):
1695 # January 2, 1956 is a Monday (0)
1696 d = self.theclass(1956, 1, 2+i)
1697 t = d.timetuple()
1698 self.assertEqual(t, (1956, 1, 2+i, 0, 0, 0, i, 2+i, -1))
1699 # February 1, 1956 is a Wednesday (2)
1700 d = self.theclass(1956, 2, 1+i)
1701 t = d.timetuple()
1702 self.assertEqual(t, (1956, 2, 1+i, 0, 0, 0, (2+i)%7, 32+i, -1))
1703 # March 1, 1956 is a Thursday (3), and is the 31+29+1 = 61st day
1704 # of the year.
1705 d = self.theclass(1956, 3, 1+i)
1706 t = d.timetuple()
1707 self.assertEqual(t, (1956, 3, 1+i, 0, 0, 0, (3+i)%7, 61+i, -1))
1708 self.assertEqual(t.tm_year, 1956)
1709 self.assertEqual(t.tm_mon, 3)
1710 self.assertEqual(t.tm_mday, 1+i)
1711 self.assertEqual(t.tm_hour, 0)
1712 self.assertEqual(t.tm_min, 0)
1713 self.assertEqual(t.tm_sec, 0)
1714 self.assertEqual(t.tm_wday, (3+i)%7)
1715 self.assertEqual(t.tm_yday, 61+i)
1716 self.assertEqual(t.tm_isdst, -1)
1717
1718 def test_pickling(self):
1719 args = 6, 7, 23

Callers

nothing calls this directly

Calls 2

timetupleMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected