Left: | ||
Right: |
LEFT | RIGHT |
---|---|
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # -*- coding: utf-8 -*- | 2 # -*- coding: utf-8 -*- |
3 """Tests for the OLE Automation date implementation.""" | 3 """Tests for the OLE Automation date implementation.""" |
4 | 4 |
5 from __future__ import unicode_literals | 5 from __future__ import unicode_literals |
6 | 6 |
7 import decimal | 7 import decimal |
8 import unittest | 8 import unittest |
9 | 9 |
10 from dfdatetime import ole_automation_date | 10 from dfdatetime import ole_automation_date |
(...skipping 18 matching lines...) Expand all Loading... | |
29 ole_automation_date_object = ole_automation_date.OLEAutomationDate( | 29 ole_automation_date_object = ole_automation_date.OLEAutomationDate( |
30 timestamp=43044.480556) | 30 timestamp=43044.480556) |
31 self.assertEqual(ole_automation_date_object.timestamp, 43044.480556) | 31 self.assertEqual(ole_automation_date_object.timestamp, 43044.480556) |
32 | 32 |
33 ole_automation_date_object = ole_automation_date.OLEAutomationDate() | 33 ole_automation_date_object = ole_automation_date.OLEAutomationDate() |
34 self.assertIsNone(ole_automation_date_object.timestamp) | 34 self.assertIsNone(ole_automation_date_object.timestamp) |
35 | 35 |
36 def testGetNormalizedTimestamp(self): | 36 def testGetNormalizedTimestamp(self): |
37 """Tests the _GetNormalizedTimestamp function.""" | 37 """Tests the _GetNormalizedTimestamp function.""" |
38 ole_automation_date_object = ole_automation_date.OLEAutomationDate( | 38 ole_automation_date_object = ole_automation_date.OLEAutomationDate( |
39 timestamp=decimal.Decimal('43044.480556')) | 39 43044.480556) |
Joachim Metz
2018/03/09 01:02:47
keep this a float
ep
2018/03/12 14:53:13
Done.
|
Joachim Metz
2018/03/13 04:37:54
missing timestamp=
|
40 | 40 |
41 normalized_timestamp = ole_automation_date_object._GetNormalizedTimestamp() | 41 normalized_timestamp = ole_automation_date_object._GetNormalizedTimestamp() |
42 self.assertEqual(normalized_timestamp, decimal.Decimal('1509881520.038400')) | 42 self.assertEqual(normalized_timestamp, decimal.Decimal('1509881520.038400')) |
43 | 43 |
44 ole_automation_date_object = ole_automation_date.OLEAutomationDate() | 44 ole_automation_date_object = ole_automation_date.OLEAutomationDate() |
45 | 45 |
46 normalized_timestamp = ole_automation_date_object._GetNormalizedTimestamp() | 46 normalized_timestamp = ole_automation_date_object._GetNormalizedTimestamp() |
47 self.assertIsNone(normalized_timestamp) | 47 self.assertIsNone(normalized_timestamp) |
48 | 48 |
49 def testCopyFromDateTimeString(self): | 49 def testCopyFromDateTimeString(self): |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
104 self.assertEqual(date_tuple, (None, None, None)) | 104 self.assertEqual(date_tuple, (None, None, None)) |
105 | 105 |
106 ole_automation_date_object = ole_automation_date.OLEAutomationDate() | 106 ole_automation_date_object = ole_automation_date.OLEAutomationDate() |
107 | 107 |
108 date_tuple = ole_automation_date_object.GetDate() | 108 date_tuple = ole_automation_date_object.GetDate() |
109 self.assertEqual(date_tuple, (None, None, None)) | 109 self.assertEqual(date_tuple, (None, None, None)) |
110 | 110 |
111 | 111 |
112 if __name__ == '__main__': | 112 if __name__ == '__main__': |
113 unittest.main() | 113 unittest.main() |
LEFT | RIGHT |