Fixed side effects checking.
Reviewers: buda Reviewed By: buda Subscribers: matej.gradicek Differential Revision: https://phabricator.memgraph.io/D131
This commit is contained in:
parent
b6fe3fc520
commit
d8a33fc667
@ -46,20 +46,20 @@ def add_side_effects(context, counters):
|
|||||||
graph_properties = context.graph_properties
|
graph_properties = context.graph_properties
|
||||||
|
|
||||||
#check nodes
|
#check nodes
|
||||||
if counters.nodes_created > 0:
|
|
||||||
graph_properties.change_nodes(counters.nodes_created)
|
|
||||||
if counters.nodes_deleted > 0:
|
if counters.nodes_deleted > 0:
|
||||||
graph_properties.change_nodes(-counters.nodes_deleted)
|
graph_properties.change_nodes(-counters.nodes_deleted)
|
||||||
|
if counters.nodes_created > 0:
|
||||||
|
graph_properties.change_nodes(counters.nodes_created)
|
||||||
#check relationships
|
#check relationships
|
||||||
if counters.relationships_created > 0:
|
|
||||||
graph_properties.change_relationships(counters.relationships_created)
|
|
||||||
if counters.relationships_deleted > 0:
|
if counters.relationships_deleted > 0:
|
||||||
graph_properties.change_relationships(-counters.relationships_deleted)
|
graph_properties.change_relationships(-counters.relationships_deleted)
|
||||||
|
if counters.relationships_created > 0:
|
||||||
|
graph_properties.change_relationships(counters.relationships_created)
|
||||||
#check labels
|
#check labels
|
||||||
if counters.labels_added > 0:
|
|
||||||
graph_properties.change_labels(counters.labels_added)
|
|
||||||
if counters.labels_removed > 0:
|
if counters.labels_removed > 0:
|
||||||
graph_properties.change_labels(-counters.labels_removed)
|
graph_properties.change_labels(-counters.labels_removed)
|
||||||
|
if counters.labels_added > 0:
|
||||||
|
graph_properties.change_labels(counters.labels_added)
|
||||||
#check properties
|
#check properties
|
||||||
if counters.properties_set > 0:
|
if counters.properties_set > 0:
|
||||||
graph_properties.change_properties(counters.properties_set)
|
graph_properties.change_properties(counters.properties_set)
|
||||||
|
@ -38,7 +38,6 @@ def parse_props(prop_json):
|
|||||||
return ""
|
return ""
|
||||||
properties = "{"
|
properties = "{"
|
||||||
for prop in prop_json:
|
for prop in prop_json:
|
||||||
print (prop + " " + str(prop_json[prop]))
|
|
||||||
if prop_json[prop] is None:
|
if prop_json[prop] is None:
|
||||||
properties += prop + ": null, "
|
properties += prop + ": null, "
|
||||||
elif isinstance(prop_json[prop], str):
|
elif isinstance(prop_json[prop], str):
|
||||||
@ -301,6 +300,7 @@ def side_effects_number(prop, table):
|
|||||||
sign = 1
|
sign = 1
|
||||||
if row[0][1:] == prop:
|
if row[0][1:] == prop:
|
||||||
ret.append(int(row[1])*sign)
|
ret.append(int(row[1])*sign)
|
||||||
|
ret.sort()
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
@then('the side effects should be')
|
@then('the side effects should be')
|
||||||
|
Loading…
Reference in New Issue
Block a user