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

Method test03_add_attribute_effect

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

Source from the content-addressed store, hash-verified

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
183
184 # no leftovers from previous test
185 self.env.assertFalse(self.monitor_containt_effect())
186
187 # set a new attribute for each supported attribute type
188 q = """MATCH (n:L) WITH n
189 LIMIT 1
190 SET
191 n.a = 1,
192 n.b = 'str',
193 n.c = True,
194 n.d = [1, [2], '3']
195 """
196
197 res = self.query_master_and_wait(q)
198 self.env.assertEquals(res.properties_set, 4)
199
200 if(expect_effect):
201 self.wait_for_effect()
202 else:
203 self.wait_for_query()
204
205 q = """MATCH ()-[e]->()
206 WITH e
207 LIMIT 1
208 SET
209 e.e = point({latitude: 51, longitude: 0}),
210 e.f=3.14,
211 e.empty_string = ''
212 """
213
214 res = self.query_master_and_wait(q)
215 self.env.assertEquals(res.properties_set, 3)
216
217 if(expect_effect):
218 self.wait_for_effect()
219 else:
220 self.wait_for_query()
221
222 self.assert_graph_eq()
223
224 def test04_create_node_effect(self, expect_effect=True):
225 # test the introduction of a new node by an effect

Callers 1

Calls 5

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