From 8d35498c06d3e832bdbcad2916efe2df9b23492d Mon Sep 17 00:00:00 2001 From: LV-426 Date: Tue, 21 Oct 2014 19:56:58 +0200 Subject: introducing the Link_Ptr concept - able to fuzzy point at a link by src_id, dst_id or both --- src-py/test_db_controller.py | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) (limited to 'src-py/test_db_controller.py') 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 -- cgit v1.3.1