Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(315)

Unified Diff: tests/fake_time.py

Issue 357750043: [dfdatetime] Use Decimal.quantize instead of round() to support Python 2 and Python 3
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « dfdatetime/interface.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/fake_time.py
diff --git a/tests/fake_time.py b/tests/fake_time.py
index 93f42cc7da6d524e321062978e8d84c70e995255..08167ebd3f9a9c6845d27ce16f884da4b8ff310d 100644
--- a/tests/fake_time.py
+++ b/tests/fake_time.py
@@ -4,6 +4,7 @@
from __future__ import unicode_literals
+import decimal
import unittest
from dfdatetime import fake_time
@@ -28,6 +29,15 @@ class FakeTimeTest(unittest.TestCase):
normalized_timestamp = fake_time_object._GetNormalizedTimestamp()
self.assertIsNone(normalized_timestamp)
+ def testGetPlasoTimestamp(self):
+ """Tests the GetPlasoTimestamp function."""
+ fake_time_object = fake_time.FakeTime()
+ fake_time_object._normalized_timestamp = decimal.Decimal(
+ '1333794697.6252465')
+ plaso_timestamp = fake_time_object.GetPlasoTimestamp()
+ self.assertEqual(plaso_timestamp, 1333794697625247)
+
+
def testCopyFromDateTimeString(self):
"""Tests the CopyFromDateTimeString function."""
fake_time_object = fake_time.FakeTime()
« no previous file with comments | « dfdatetime/interface.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b