def test_dec_31(self): self.assertEqual(ordinal.to_gregorian(2001, 364), (2001, 12, 30), 'December 30, 2001') self.assertEqual(ordinal.to_gregorian(2004, 365), (2004, 12, 30)) self.assertEqual(ordinal.to_gregorian(2001, 365), (2001, 12, 31)) self.assertEqual(ordinal.to_gregorian(2004, 366), (2004, 12, 31)) self.assertEqual(ordinal.from_gregorian(2001, 12, 30), (2001, 364)) self.assertEqual(ordinal.from_gregorian(2004, 12, 30), (2004, 365)) self.assertEqual(ordinal.from_gregorian(2001, 12, 31), (2001, 365)) self.assertEqual(ordinal.from_gregorian(2004, 12, 31), (2004, 366))
def test_ordinal_to_gregorian(self): self.assertEqual(ordinal.to_gregorian(2013, 1), (2013, 1, 1)) self.assertEqual(ordinal.to_gregorian(2013, 105), (2013, 4, 15)) self.assertEqual(ordinal.to_gregorian(2013, 32), (2013, 2, 1)) self.assertEqual(ordinal.to_gregorian(2012, 1), (2012, 1, 1)) self.assertEqual(ordinal.to_gregorian(2012, 31), (2012, 1, 31)) self.assertEqual(ordinal.to_gregorian(2012, 32), (2012, 2, 1)) self.assertEqual(ordinal.to_gregorian(2012, 52), (2012, 2, 21)) self.assertEqual(ordinal.to_gregorian(2012, 59), (2012, 2, 28)) self.assertEqual(ordinal.to_gregorian(2012, 60), (2012, 2, 29)) self.assertEqual(ordinal.to_gregorian(2012, 61), (2012, 3, 1))