summaryrefslogtreecommitdiff
path: root/src/server-tests/test_db_controller.py
diff options
context:
space:
mode:
authorLV-426 <lv-426@taproot.org.il>2015-01-11 15:28:50 +0200
committerLV-426 <lv-426@taproot.org.il>2015-01-11 18:30:42 +0200
commit049a3888d8e1058527328d0632cdc4f7305b7c33 (patch)
treebf9dcca544d204fb9b3d51357a9732f4422727c0 /src/server-tests/test_db_controller.py
parentfc1d7a6db3b9b8f41712002a033488d11c07ec65 (diff)
test_db_controller.py: test ordering
Diffstat (limited to 'src/server-tests/test_db_controller.py')
-rw-r--r--src/server-tests/test_db_controller.py68
1 files changed, 34 insertions, 34 deletions
diff --git a/src/server-tests/test_db_controller.py b/src/server-tests/test_db_controller.py
index 8d692b03..fb801048 100644
--- a/src/server-tests/test_db_controller.py
+++ b/src/server-tests/test_db_controller.py
@@ -237,40 +237,6 @@ class TestDBController(unittest.TestCase):
ret_diff = self.db_ctl.exec_op(op)
self.assertTrue('attr_2' in ret_diff.type__node[n_0_id]['__attr_remove'])
- def test_match_node_set_by_type(self):
- op = DBO_match_node_id_set(filter_label='Person')
- id_set = self.db_ctl.exec_op(op)
- self.assertEqual(len(id_set), 2)
-
- op = DBO_match_node_id_set(filter_label='Nan_Type')
- id_set = self.db_ctl.exec_op(op)
- self.assertEqual(len(id_set), 0)
-
- def test_match_node_set_by_attribute(self):
- fam = { 'name': ['Bob', u'Judo'], 'age': [128] }
- n_set = self.db_ctl.exec_op(DBO_match_node_id_set(filter_attr_map=fam))
- self.assertEqual(len(n_set), 1)
-
- fam = { 'age': [128, 256, 404] }
- n_set = self.db_ctl.exec_op(DBO_match_node_id_set(filter_attr_map=fam))
- self.assertEqual(len(n_set), 2)
-
- def test_match_node_set_by_DB_id(self):
- pass # TODO
-
- def test_match_node_set_by_id_attribute(self):
- n_set = self.db_ctl.exec_op(DBO_match_node_set_by_id_attribute(['skill_00', 'person_01']))
- self.assertEqual(len(n_set), 2)
-
- def test_match_link_set_by_type(self):
- op = DBO_match_link_id_set(filter_label='Knows')
- id_set = self.db_ctl.exec_op(op)
- self.assertEqual(len(id_set), 2)
-
- op = DBO_match_link_id_set(filter_label='Nan_Type')
- id_set = self.db_ctl.exec_op(op)
- self.assertEqual(len(id_set), 0)
-
def test_load_link_set(self):
# load by l_ptr
@@ -317,6 +283,40 @@ class TestDBController(unittest.TestCase):
n_set = self.db_ctl.exec_op(op)
self.assertEqual(len(n_set), len(id_set), 'incorrect result size')
+ def test_match_node_set_by_type(self):
+ op = DBO_match_node_id_set(filter_label='Person')
+ id_set = self.db_ctl.exec_op(op)
+ self.assertEqual(len(id_set), 2)
+
+ op = DBO_match_node_id_set(filter_label='Nan_Type')
+ id_set = self.db_ctl.exec_op(op)
+ self.assertEqual(len(id_set), 0)
+
+ def test_match_node_set_by_attribute(self):
+ fam = { 'name': ['Bob', u'Judo'], 'age': [128] }
+ n_set = self.db_ctl.exec_op(DBO_match_node_id_set(filter_attr_map=fam))
+ self.assertEqual(len(n_set), 1)
+
+ fam = { 'age': [128, 256, 404] }
+ n_set = self.db_ctl.exec_op(DBO_match_node_id_set(filter_attr_map=fam))
+ self.assertEqual(len(n_set), 2)
+
+ def test_match_node_set_by_DB_id(self):
+ pass # TODO
+
+ def test_match_node_set_by_id_attribute(self):
+ n_set = self.db_ctl.exec_op(DBO_match_node_set_by_id_attribute(['skill_00', 'person_01']))
+ self.assertEqual(len(n_set), 2)
+
+ def test_match_link_set_by_type(self):
+ op = DBO_match_link_id_set(filter_label='Knows')
+ id_set = self.db_ctl.exec_op(op)
+ self.assertEqual(len(id_set), 2)
+
+ op = DBO_match_link_id_set(filter_label='Nan_Type')
+ id_set = self.db_ctl.exec_op(op)
+ self.assertEqual(len(id_set), 0)
+
def test_partial_query_set_execution_success(self):
"""
test: