Skip to content

Commit ea06e82

Browse files
committed
updating tests
1 parent a2287c2 commit ea06e82

1 file changed

Lines changed: 17 additions & 3 deletions

File tree

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,28 @@
11
from ted_sws.notice_publisher_triple_store.services.load_transformed_notice_into_triple_store import \
2-
load_notice_into_triple_store
2+
load_notice_into_triple_store, DEFAULT_NOTICE_REPOSITORY_NAME
33
from tests.fakes.fake_repository import FakeNoticeRepository
44

55

6+
SPARQL_QUERY = "select * {?s ?p ?o}"
7+
Grath = "SELECT * WHERE { { GRAPH ?g { ?s ?p ?o } }"
8+
69
def test_load_notice_into_triple_store(transformed_complete_notice, allegro_triple_store):
710
fake_notice_repo = FakeNoticeRepository()
811
fake_notice_repo.add(transformed_complete_notice)
9-
1012
load_notice_into_triple_store(notice_id=transformed_complete_notice.ted_id, notice_repository=fake_notice_repo,
1113
triple_store_repository=allegro_triple_store)
1214

13-
assert True
15+
sparql_endpoint = allegro_triple_store.get_sparql_triple_store_endpoint(DEFAULT_NOTICE_REPOSITORY_NAME)
16+
assert sparql_endpoint is not None
17+
18+
query_result = sparql_endpoint.with_query(sparql_query=SPARQL_QUERY).fetch_tree()
19+
assert query_result
20+
print(query_result)
21+
# assert that the graph in the triple store has more that 1 triple inside
22+
if len(SPARQL_QUERY) in query_result >= 1:
23+
assert True
24+
# assert that at least one graph exists in the triple store
25+
if SPARQL_QUERY in query_result:
26+
assert True
27+
# assert that the there is an epo:Identifier object that has the value equal to the notice ID
1428

0 commit comments

Comments
 (0)