MCPcopy Create free account
hub / github.com/RedisGraph/RedisGraph / test02_add_schema_effect

Method test02_add_schema_effect

tests/flow/test_effects.py:142–179  ·  view source on GitHub ↗
(self, expect_effect=True)

Source from the content-addressed store, hash-verified

140 self.env.assertTrue(self.effects_enabled())
141
142 def test02_add_schema_effect(self, expect_effect=True):
143 # test the introduction of a schema by an effect
144
145 # introduce a new label which in turn creates a new schema
146 q = "CREATE (:L)"
147 res = self.query_master_and_wait(q)
148 self.env.assertEquals(res.nodes_created, 1)
149
150 if(expect_effect):
151 self.wait_for_effect()
152 else:
153 self.wait_for_query()
154
155 self.assert_graph_eq()
156
157 # introduce multiple labels
158 q = "CREATE (:X:Y)"
159 res = self.query_master_and_wait(q)
160 self.env.assertEquals(res.labels_added, 2)
161 self.env.assertEquals(res.nodes_created, 1)
162
163 if(expect_effect):
164 self.wait_for_effect()
165 else:
166 self.wait_for_query()
167
168 self.assert_graph_eq()
169
170 # introduce a new relationship-type which in turn creates a new schema
171 q = "CREATE ()-[:R]->()"
172 res = self.query_master_and_wait(q)
173
174 if(expect_effect):
175 self.wait_for_effect()
176 else:
177 self.wait_for_query()
178
179 self.assert_graph_eq()
180
181 def test03_add_attribute_effect(self, expect_effect=True):
182 # test the introduction of an attribute by an effect

Callers 1

Calls 4

query_master_and_waitMethod · 0.95
wait_for_effectMethod · 0.95
wait_for_queryMethod · 0.95
assert_graph_eqMethod · 0.95

Tested by

no test coverage detected