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

Unified Diff: tests/java_time.py

Issue 337640043: [dfdatetime] Replace float with decimal for normalized timestamps. (Closed)
Patch Set: Replace float with decimal for normalized timestamps. Created 6 years 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
Index: tests/java_time.py
diff --git a/tests/java_time.py b/tests/java_time.py
index 13ce4b2b408df11f8bfb5f87d6ab1df1f4c9c863..64a83cbc9a55b55e3c15238104113a064523a06c 100644
--- a/tests/java_time.py
+++ b/tests/java_time.py
@@ -4,6 +4,7 @@
from __future__ import unicode_literals
+import decimal
import unittest
from dfdatetime import java_time
@@ -27,7 +28,7 @@ class JavaTimeTest(unittest.TestCase):
java_time_object = java_time.JavaTime(timestamp=1281643591546)
normalized_timestamp = java_time_object._GetNormalizedTimestamp()
- self.assertEqual(normalized_timestamp, 1281643591.546)
+ self.assertEqual(normalized_timestamp, decimal.Decimal('1281643591.546'))
java_time_object = java_time.JavaTime()

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