tinkerpop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From spmalle...@apache.org
Subject [03/15] tinkerpop git commit: added asserts to check values are deserialized as expected
Date Thu, 30 Nov 2017 12:06:23 GMT
added asserts to check values are deserialized as expected


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/c0078cc1
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/c0078cc1
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/c0078cc1

Branch: refs/heads/TINKERPOP-1734
Commit: c0078cc172e918f96460630da27ff04cb4e9478d
Parents: 4661284
Author: davebshow <davebshow@gmail.com>
Authored: Mon Nov 13 10:11:46 2017 -0800
Committer: davebshow <davebshow@gmail.com>
Committed: Mon Nov 13 10:11:46 2017 -0800

----------------------------------------------------------------------
 .../src/main/jython/tests/structure/io/test_graphson.py          | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/c0078cc1/gremlin-python/src/main/jython/tests/structure/io/test_graphson.py
----------------------------------------------------------------------
diff --git a/gremlin-python/src/main/jython/tests/structure/io/test_graphson.py b/gremlin-python/src/main/jython/tests/structure/io/test_graphson.py
index 75e7136..68d14ca 100644
--- a/gremlin-python/src/main/jython/tests/structure/io/test_graphson.py
+++ b/gremlin-python/src/main/jython/tests/structure/io/test_graphson.py
@@ -128,15 +128,18 @@ class TestGraphSONReader(object):
     def test_datetime(self):
         dt = self.graphson_reader.readObject(json.dumps({"@type": "g:Date", "@value": 1481750076295}))
         assert isinstance(dt, datetime.datetime)
+        assert dt == datetime.datetime(2016, 12, 14, 13, 14, 36, 295000)
 
     def test_timestamp(self):
         dt = self.graphson_reader.readObject(json.dumps({"@type": "g:Timestamp", "@value":
1481750076295}))
         assert isinstance(dt, timestamp)
+        assert float(dt) == 1481750076.295
 
     def test_uuid(self):
         prop = self.graphson_reader.readObject(
             json.dumps({'@type': 'g:UUID', '@value': "41d2e28a-20a4-4ab0-b379-d810dede3786"}))
         assert isinstance(prop, uuid.UUID)
+        assert str(prop) == '41d2e28a-20a4-4ab0-b379-d810dede3786'
 
 
 class TestGraphSONWriter(object):
@@ -260,6 +263,7 @@ class TestGraphSONWriter(object):
         output = self.graphson_writer.writeObject(prop)
         assert expected == output
 
+
 class TestFunctionalGraphSONIO(object):
     """Functional IO tests"""
 


Mime
View raw message