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

Method test_07_test_optimizations_index

tests/flow/test_cache.py:123–138  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

121
122
123 def test_07_test_optimizations_index(self):
124 graph = Graph(redis_con, 'Cache_Test_Index')
125 create_node_exact_match_index(graph, 'N', 'val', sync=True)
126 query = "CREATE (:N{val:1}), (:N{val:2})"
127 graph.query(query)
128 query = "MATCH (n:N{val:$val}) RETURN n.val"
129 params = {'val':1}
130 self.compare_uncached_to_cached_query_plans(query, params)
131 uncached_result = graph.query(query, params)
132 params = {'val':2}
133 cached_result = graph.query(query, params)
134 self.env.assertFalse(uncached_result.cached_execution)
135 self.env.assertTrue(cached_result.cached_execution)
136 self.env.assertEqual([[1]], uncached_result.result_set)
137 self.env.assertEqual([[2]], cached_result.result_set)
138 graph.delete()
139
140
141 def test_08_test_optimizations_id_scan(self):

Callers

nothing calls this directly

Calls 4

GraphClass · 0.85
queryMethod · 0.45

Tested by

no test coverage detected