Add new text fixture

This commit is contained in:
Ante Pušić 2024-01-15 20:30:08 +01:00
parent 8f0250c265
commit 085b5b8284
2 changed files with 30 additions and 17 deletions

View File

@ -43,3 +43,16 @@ def memgraph(**kwargs) -> Memgraph:
memgraph.drop_database()
memgraph.drop_indexes()
@pytest.fixture
def memgraph_with_text_indexed_data(**kwargs) -> Memgraph:
memgraph = Memgraph()
memgraph.execute_and_fetch("CREATE TEXT INDEX complianceDocuments ON :Document;")
yield memgraph
memgraph.execute_and_fetch("DROP TEXT INDEX complianceDocuments;")
memgraph.drop_database()
memgraph.drop_indexes()

View File

@ -12,7 +12,7 @@
import sys
import pytest
from common import memgraph
from common import memgraph, memgraph_with_text_indexed_data
def test_create_index(memgraph):
@ -26,36 +26,36 @@ def test_drop_index(memgraph):
assert True
def test_text_search_given_property():
assert True
def test_text_search_given_property(memgraph_with_text_indexed_data):
memgraph_with_text_indexed_data.execute_and_fetch("CALL text_search.search('complianceDocuments', 'b') YIELD *;")
def test_text_search_all_properties():
assert True
def test_text_search_all_properties(memgraph_with_text_indexed_data):
memgraph_with_text_indexed_data.execute_and_fetch("CALL text_search.search('complianceDocuments', 'b') YIELD *;")
def test_create_indexed_node():
assert True
def test_create_indexed_node(memgraph_with_text_indexed_data):
memgraph_with_text_indexed_data.execute_and_fetch("CALL text_search.search('complianceDocuments', 'b') YIELD *;")
def test_delete_indexed_node():
assert True
def test_delete_indexed_node(memgraph_with_text_indexed_data):
memgraph_with_text_indexed_data.execute_and_fetch("CALL text_search.search('complianceDocuments', 'b') YIELD *;")
def test_add_indexed_label():
assert True
def test_add_indexed_label(memgraph_with_text_indexed_data):
memgraph_with_text_indexed_data.execute_and_fetch("CALL text_search.search('complianceDocuments', 'b') YIELD *;")
def test_remove_indexed_label():
assert True
def test_remove_indexed_label(memgraph_with_text_indexed_data):
memgraph_with_text_indexed_data.execute_and_fetch("CALL text_search.search('complianceDocuments', 'b') YIELD *;")
def test_add_property_to_indexed_node():
assert True
def test_add_property_to_indexed_node(memgraph_with_text_indexed_data):
memgraph_with_text_indexed_data.execute_and_fetch("CALL text_search.search('complianceDocuments', 'b') YIELD *;")
def test_remove_property_from_indexed_node():
assert True
def test_remove_property_from_indexed_node(memgraph_with_text_indexed_data):
memgraph_with_text_indexed_data.execute_and_fetch("CALL text_search.search('complianceDocuments', 'b') YIELD *;")
if __name__ == "__main__":