From 54f2c9efba0c9b61d6257fddf3c387025fe5085a Mon Sep 17 00:00:00 2001 From: Dennis Priskorn <68460690+dpriskorn@users.noreply.github.com> Date: Thu, 6 Oct 2022 10:50:27 +0200 Subject: [PATCH] Remove empty test_query.py --- tests/test_preprint_article.py | 11 ++++++++--- tests/test_published_article.py | 13 ++++++++++--- tests/test_query.py | 9 --------- tests/test_riksdagen_document.py | 15 +++++++++++---- tests/test_thesis.py | 11 ++++++++--- 5 files changed, 37 insertions(+), 22 deletions(-) delete mode 100644 tests/test_query.py diff --git a/tests/test_preprint_article.py b/tests/test_preprint_article.py index 9bf1dec..57db65c 100644 --- a/tests/test_preprint_article.py +++ b/tests/test_preprint_article.py @@ -23,7 +23,9 @@ def test_preprint_article_query(self): q.search_string = string q.__prepare_and_build_query__() print(q.query_string) - assert q.query_string.replace(" ","").strip() == """ + assert ( + q.query_string.replace(" ", "").strip() + == """ #ItemSubjector (https://github.com/dpriskorn/ItemSubjector), User:So9q SELECT DISTINCT ?item ?itemLabel WHERE { @@ -42,5 +44,8 @@ def test_preprint_article_query(self): ) MINUS {?item wdt:P921/wdt:P279 wd:Q407541. } SERVICE wikibase:label { bd:serviceParam wikibase:language "en". } - }""".replace(" ","").strip() - break \ No newline at end of file + }""".replace( + " ", "" + ).strip() + ) + break diff --git a/tests/test_published_article.py b/tests/test_published_article.py index 5e8cdc3..137a1fe 100644 --- a/tests/test_published_article.py +++ b/tests/test_published_article.py @@ -24,7 +24,9 @@ def test_published_article_query(self): q.search_string = string q.__prepare_and_build_query__() print(q.query_string) - assert q.query_string.replace(" ","").replace("\\", "").strip() == """ + assert ( + q.query_string.replace(" ", "").replace("\\", "").strip() + == """ #ItemSubjector (https://github.com/dpriskorn/ItemSubjector), User:So9q SELECT DISTINCT ?item ?itemLabel WHERE { @@ -54,5 +56,10 @@ def test_published_article_query(self): MINUS {?item wdt:P921/wdt:P279/wdt:P279 wd:Q407541. } MINUS {?item wdt:P921/wdt:P279/wdt:P279/wdt:P279 wd:Q407541. } SERVICE wikibase:label { bd:serviceParam wikibase:language "en". } - }""".replace(" ","").replace("\\", "").strip() - break \ No newline at end of file + }""".replace( + " ", "" + ) + .replace("\\", "") + .strip() + ) + break diff --git a/tests/test_query.py b/tests/test_query.py deleted file mode 100644 index 14bd9fe..0000000 --- a/tests/test_query.py +++ /dev/null @@ -1,9 +0,0 @@ -from src.models.wikimedia.wikidata.query import Query - - -class TestQuery: - def test_parse_results(self): - pass - def test_build_query(self): - """We test that all the parameters are taken into consideration""" - q = Query() \ No newline at end of file diff --git a/tests/test_riksdagen_document.py b/tests/test_riksdagen_document.py index bb6b974..d66604a 100644 --- a/tests/test_riksdagen_document.py +++ b/tests/test_riksdagen_document.py @@ -3,7 +3,9 @@ from src import tasks from src.models.wikimedia.wikidata.item.main_subject import MainSubjectItem -from src.models.wikimedia.wikidata.query.riksdagen_document import RiksdagenDocumentQuery +from src.models.wikimedia.wikidata.query.riksdagen_document import ( + RiksdagenDocumentQuery, +) class TestRiksdagenDocumentQuery(TestCase): @@ -23,7 +25,9 @@ def test_riksdagen_document_query(self): q.search_string = string q.__prepare_and_build_query__() print(q.query_string) - assert q.query_string.replace(" ","").strip() == """ + assert ( + q.query_string.replace(" ", "").strip() + == """ #ItemSubjector (https://github.com/dpriskorn/ItemSubjector), User:So9q SELECT DISTINCT ?item ?itemLabel WHERE { @@ -47,5 +51,8 @@ def test_riksdagen_document_query(self): # Thanks to Jan Ainali for this improvement :) MINUS {?main_subject_item wdt:P921 ?topic. ?topic wdt:P279 wd:Q407541. } SERVICE wikibase:label { bd:serviceParam wikibase:language "sv". } - }""".replace(" ","").strip() - break \ No newline at end of file + }""".replace( + " ", "" + ).strip() + ) + break diff --git a/tests/test_thesis.py b/tests/test_thesis.py index 62efe70..784ac6b 100644 --- a/tests/test_thesis.py +++ b/tests/test_thesis.py @@ -23,7 +23,9 @@ def test_thesis_query(self): q.search_string = string q.__prepare_and_build_query__() print(q.query_string) - assert q.query_string.replace(" ","").strip() == """ + assert ( + q.query_string.replace(" ", "").strip() + == """ #ItemSubjector (https://github.com/dpriskorn/ItemSubjector), User:So9q SELECT DISTINCT ?item ?itemLabel WHERE { @@ -45,5 +47,8 @@ def test_thesis_query(self): REGEX(LCASE(?label), "^fentanyl .*"@en)) MINUS {?item wdt:P921 ?topic. ?topic wdt:P279 wd:Q407541. } SERVICE wikibase:label { bd:serviceParam wikibase:language "en". } - }""".replace(" ","").strip() - break \ No newline at end of file + }""".replace( + " ", "" + ).strip() + ) + break