summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/server-tests/test_db_controller.py26
-rw-r--r--src/server/db_op.py8
-rw-r--r--src/server/rz_api.py4
-rw-r--r--src/server/rz_kernel.py8
4 files changed, 23 insertions, 23 deletions
diff --git a/src/server-tests/test_db_controller.py b/src/server-tests/test_db_controller.py
index 895ad2bd..9b58f148 100644
--- a/src/server-tests/test_db_controller.py
+++ b/src/server-tests/test_db_controller.py
@@ -10,13 +10,13 @@ from db_op import DBO_block_chain__list
from db_op import DBO_match_node_set_by_id_attribute
from db_op import DBO_match_link_id_set
from db_op import DBO_add_node_set
-from db_op import DBO_attr_diff_commit
+from db_op import DBO_diff_commit__attr
from db_op import DBO_load_link_set
from db_op import DBO_load_node_set_by_DB_id
from db_op import DBO_match_node_id_set
from db_op import DBO_rm_node_set
from db_op import DBO_rz_clone
-from db_op import DBO_topo_diff_commit
+from db_op import DBO_diff_commit__topo
from model.graph import Attr_Diff
from model.graph import Topo_Diff
from model.model import Link
@@ -234,11 +234,11 @@ class TestDBController(unittest.TestCase):
n_set = self.db_ctl.exec_op(DBO_match_node_set_by_id_attribute([n_id]))
self.assertEqual(len(n_set), 0)
- def test_topo_diff_commit(self):
+ def test_diff_commit__topo(self):
n_0_id = rand_id()
n_1_id = rand_id()
n_2_id = rand_id()
- n_T = 'T_test_topo_diff_commit'
+ n_T = 'T_test_diff_commit__topo'
n_set = [{'__label_set': n_T, 'id': n_0_id },
{'__label_set': n_T, 'id': n_1_id },
@@ -249,7 +249,7 @@ class TestDBController(unittest.TestCase):
topo_diff = Topo_Diff(node_set_add=n_set,
link_set_add=l_set)
- op = DBO_topo_diff_commit(topo_diff)
+ op = DBO_diff_commit__topo(topo_diff)
op_ret = self.db_ctl.exec_op(op)
self.assertEqual(len(op_ret), 2) # to id-sets, nodes & links
self.assertEqual(len(op_ret[0]), 3) # expect id-set of length 3
@@ -268,18 +268,18 @@ class TestDBController(unittest.TestCase):
id_set_rm = [n_2_id]
topo_diff = Topo_Diff(node_set_rm=id_set_rm)
- op = DBO_topo_diff_commit(topo_diff)
+ op = DBO_diff_commit__topo(topo_diff)
self.db_ctl.exec_op(op)
op = DBO_match_node_set_by_id_attribute(id_set_rm)
id_set = self.db_ctl.exec_op(op)
self.assertEqual(len(id_set), 0)
- def test_attr_diff_commit(self):
+ def test_diff_commit__attr(self):
# create test node
n_id = rand_id()
- topo_diff = Topo_Diff(node_set_add=[{'__label_set': ['T_test_attr_diff_commit'],
+ topo_diff = Topo_Diff(node_set_add=[{'__label_set': ['T_test_diff_commit__attr'],
'id': n_id, 'attr_0': 0}])
- op = DBO_topo_diff_commit(topo_diff)
+ op = DBO_diff_commit__topo(topo_diff)
self.db_ctl.exec_op(op)
# apply attr_diff
@@ -288,7 +288,7 @@ class TestDBController(unittest.TestCase):
attr_diff.add_node_attr_write(n_id, 'attr_1', 'a')
attr_diff.add_node_attr_rm(n_id, 'attr_2')
- op = DBO_attr_diff_commit(attr_diff)
+ op = DBO_diff_commit__attr(attr_diff)
ret_diff = self.db_ctl.exec_op(op)
self.assertEqual(len(ret_diff.type__node), 1)
@@ -298,7 +298,7 @@ class TestDBController(unittest.TestCase):
attr_diff = Attr_Diff()
attr_diff.add_node_attr_write(n_id, 'attr_2', 0)
- op = DBO_attr_diff_commit(attr_diff)
+ op = DBO_diff_commit__attr(attr_diff)
ret_diff = self.db_ctl.exec_op(op)
self.assertTrue(None != ret_diff.type__node[n_id]['__attr_write'].get('attr_2'))
@@ -306,7 +306,7 @@ class TestDBController(unittest.TestCase):
attr_diff = Attr_Diff()
attr_diff.add_node_attr_rm(n_id, 'attr_2')
- op = DBO_attr_diff_commit(attr_diff)
+ op = DBO_diff_commit__attr(attr_diff)
ret_diff = self.db_ctl.exec_op(op)
self.assertTrue('attr_2' in ret_diff.type__node[n_id]['__attr_remove'])
@@ -327,7 +327,7 @@ class TestDBController(unittest.TestCase):
topo_diff = Topo_Diff(node_set_add=n_set,
link_set_add=l_set)
- op = DBO_topo_diff_commit(topo_diff)
+ op = DBO_diff_commit__topo(topo_diff)
self.db_ctl.exec_op(op)
op = DBO_rm_node_set([n_0_id, n_1_id])
diff --git a/src/server/db_op.py b/src/server/db_op.py
index 1dee7fe1..22800953 100644
--- a/src/server/db_op.py
+++ b/src/server/db_op.py
@@ -232,14 +232,14 @@ class DBO_cypher_query(DB_op):
super(DBO_cypher_query, self).__init__()
self.add_statement(q, q_params)
-class DBO_topo_diff_commit(DB_composed_op):
+class DBO_diff_commit__topo(DB_composed_op):
"""
commit a Topo_Diff
@return: a Topo_Diff of the actual committed changes
"""
def __init__(self, topo_diff):
- super(DBO_topo_diff_commit, self).__init__()
+ super(DBO_diff_commit__topo, self).__init__()
n_add_map = db_util.meta_attr_list_to_meta_attr_map(topo_diff.node_set_add)
l_add_map = db_util.meta_attr_list_to_meta_attr_map(topo_diff.link_set_add)
@@ -322,7 +322,7 @@ class DBO_topo_diff_commit(DB_composed_op):
return topo_diff
-class DBO_attr_diff_commit(DB_op):
+class DBO_diff_commit__attr(DB_op):
"""
commit a Attr_Diff, return an Attr_Diff
@@ -331,7 +331,7 @@ class DBO_attr_diff_commit(DB_op):
actually changed, only that it has been 'touched'
"""
def __init__(self, attr_diff):
- super(DBO_attr_diff_commit, self).__init__()
+ super(DBO_diff_commit__attr, self).__init__()
self.op_return_value__attr_diff = attr_diff # cache attr_diff as return value on success
diff --git a/src/server/rz_api.py b/src/server/rz_api.py
index aded30a9..3b6d9585 100644
--- a/src/server/rz_api.py
+++ b/src/server/rz_api.py
@@ -33,7 +33,7 @@ from db_op import DBO_match_node_set_by_id_attribute
from db_op import DBO_match_node_id_set
from db_op import DBO_load_link_set
from db_op import DBO_rz_clone
-from db_op import DBO_topo_diff_commit
+from db_op import DBO_diff_commit__topo
from db_op import DBO_add_node_set
@@ -136,7 +136,7 @@ def diff_commit__set():
topo_diff = sanitize_input(request)
- op = DBO_topo_diff_commit(topo_diff)
+ op = DBO_diff_commit__topo(topo_diff)
return __common_exec(op)
def add_node_set():
diff --git a/src/server/rz_kernel.py b/src/server/rz_kernel.py
index 46236e97..75fc959a 100644
--- a/src/server/rz_kernel.py
+++ b/src/server/rz_kernel.py
@@ -4,8 +4,8 @@ Rhizi kernel, home to core operation login
import db_controller
import logging
import traceback
-from db_op import DBO_attr_diff_commit
-from db_op import DBO_topo_diff_commit
+from db_op import DBO_diff_commit__attr
+from db_op import DBO_diff_commit__topo
log = logging.getLogger('rhizi')
@@ -18,7 +18,7 @@ class RZ_Kernel(object):
- socket.io calls
- future interfaces
"""
- op = DBO_topo_diff_commit(topo_diff)
+ op = DBO_diff_commit__topo(topo_diff)
try:
op_ret = db_ctl.exec_op(op)
return op_ret
@@ -28,7 +28,7 @@ class RZ_Kernel(object):
raise e
def diff_commit__attr(self, db_ctl, attr_diff):
- op = DBO_attr_diff_commit(attr_diff)
+ op = DBO_diff_commit__attr(attr_diff)
try:
op_ret = db_ctl.exec_op(op)
return op_ret