Skip to content

Commit

Permalink
gripql/python: added a basic test
Browse files Browse the repository at this point in the history
adamstruck committed Sep 25, 2018
1 parent 6029083 commit 576bb48
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions gripql/python/tests/wrap_value_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import unittest

from gripql.query import Query


class TestQueryFormat(unittest.TestCase):

def test_wrapping_none(self):
q = Query("localhost", "test")
self.assertEqual(q.V().in_().to_json(), q.V().in_(None).to_json())
self.assertEqual(q.V().out().to_json(), q.V().out(None).to_json())
self.assertEqual(q.V().both().to_json(), q.V().both(None).to_json())
with self.assertRaises(TypeError):
q.V().in_(["foo", None]).to_json()
with self.assertRaises(TypeError):
q.V().in_(["foo", 1]).to_json()
with self.assertRaises(TypeError):
q.V().in_(1).to_json()

0 comments on commit 576bb48

Please sign in to comment.