summaryrefslogtreecommitdiff
path: root/src-py/test_db_controller.py
diff options
context:
space:
mode:
authorLV-426 <lv-426@taproot.org.il>2014-10-21 19:56:58 +0200
committerLV-426 <lv-426@taproot.org.il>2014-10-21 19:56:58 +0200
commit8d35498c06d3e832bdbcad2916efe2df9b23492d (patch)
tree2cc8edfcfe026dd0c493c53be2ac215d113c8df9 /src-py/test_db_controller.py
parentc97f56e93d3bb3a7b838093b0ecb4fec9c9e0d34 (diff)
introducing the Link_Ptr concept - able to fuzzy point at a link by src_id, dst_id or both
Diffstat (limited to 'src-py/test_db_controller.py')
-rw-r--r--src-py/test_db_controller.py29
1 files changed, 19 insertions, 10 deletions
diff --git a/src-py/test_db_controller.py b/src-py/test_db_controller.py
index 4af4cabc..cdc0c5e9 100644
--- a/src-py/test_db_controller.py
+++ b/src-py/test_db_controller.py
@@ -122,19 +122,28 @@ class TestDBController(unittest.TestCase):
id_set = self.db_ctl.exec_op(op)
self.assertEqual(len(id_set), 0)
- def test_match_link_set_by_src_or_dst_id_attributes(self):
- op = dbc.DBO_match_link_set_by_src_or_dst_id_attributes(src_id='person_00', dst_id='skill_00')
- n_set = self.db_ctl.exec_op(op)
- self.assertEqual(len(n_set), 1)
+ def test_load_link_set(self):
+ l_ptr = Link.link_ptr(src_id='person_00', dst_id='skill_00')
+ op = dbc.DBO_load_link_set.init_from_link_ptr(l_ptr)
+ l_set = self.db_ctl.exec_op(op)
+ self.assertEqual(len(l_set), 1)
- op = dbc.DBO_match_link_set_by_src_or_dst_id_attributes(src_id='person_00')
- n_set = self.db_ctl.exec_op(op)
- self.assertEqual(len(n_set), 2)
+ l_ptr = Link.link_ptr(src_id='person_00')
+ op = dbc.DBO_load_link_set.init_from_link_ptr(l_ptr)
+ l_set = self.db_ctl.exec_op(op)
+ self.assertEqual(len(l_set), 2)
- op = dbc.DBO_match_link_set_by_src_or_dst_id_attributes(dst_id='skill_00')
- n_set = self.db_ctl.exec_op(op)
- self.assertEqual(len(n_set), 1)
+ l_ptr = Link.link_ptr(dst_id='skill_00')
+ op = dbc.DBO_load_link_set.init_from_link_ptr(l_ptr)
+ l_set = self.db_ctl.exec_op(op)
+ self.assertEqual(len(l_set), 1)
+ # load sets
+ l_ptr_set = [Link.link_ptr(s,d) for (s,d) in [('person_00', 'skill_00'), ('person_00', 'skill_01')]]
+ op = dbc.DBO_load_link_set.init_from_link_ptr_set(l_ptr_set)
+ l_set = self.db_ctl.exec_op(op)
+ self.assertEqual(len(l_set), 2)
+
def test_load_node_set_by_DB_id(self):
"""
test node DB id life cycle