Back to index

python3.2  3.2.2
Public Member Functions
test.datetimetester.TestDateOnly Class Reference

List of all members.

Public Member Functions

def test_delta_non_days_ignored

Detailed Description

Definition at line 718 of file datetimetester.py.


Member Function Documentation

Definition at line 722 of file datetimetester.py.

00722 
00723     def test_delta_non_days_ignored(self):
00724         dt = date(2000, 1, 2)
00725         delta = timedelta(days=1, hours=2, minutes=3, seconds=4,
00726                           microseconds=5)
00727         days = timedelta(delta.days)
00728         self.assertEqual(days, timedelta(1))
00729 
00730         dt2 = dt + delta
00731         self.assertEqual(dt2, dt + days)
00732 
00733         dt2 = delta + dt
00734         self.assertEqual(dt2, dt + days)
00735 
00736         dt2 = dt - delta
00737         self.assertEqual(dt2, dt - days)
00738 
00739         delta = -delta
00740         days = timedelta(delta.days)
00741         self.assertEqual(days, timedelta(-2))
00742 
00743         dt2 = dt + delta
00744         self.assertEqual(dt2, dt + days)
00745 
00746         dt2 = delta + dt
00747         self.assertEqual(dt2, dt + days)
00748 
00749         dt2 = dt - delta
00750         self.assertEqual(dt2, dt - days)

Here is the call graph for this function:


The documentation for this class was generated from the following file: