Skip to content

Commit

Permalink
Removing an incorrect test and excess print statements
Browse files Browse the repository at this point in the history
  • Loading branch information
Teester committed Jun 15, 2024
1 parent 2814e68 commit 5120ca8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 16 deletions.
4 changes: 1 addition & 3 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,11 @@


@app.route("/api")
def data():
def v1():
"""
Compares an entityschema with a wikidata item
:return: a response to the query
"""
print("v1")
schema: str = request.args.get("entityschema", type=str)
entity: str = request.args.get("entity", type=str)
if "Lexeme" in entity:
Expand Down Expand Up @@ -64,7 +63,6 @@ def v2():
Compares an entityschema with a wikidata item
:return: a response to the query
"""
print("v2")
schema: str = request.args.get("entityschema", type=str)
entity: str = request.args.get("entity", type=str)
if "Lexeme" in entity:
Expand Down
14 changes: 1 addition & 13 deletions test_schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ def test_wikidata_entityschemas(self) -> None:
with self.subTest(schema=schema):
if schema in skips:
self.skipTest(f"Schema {schema} not supported")
print(schema)
response = self.app.get(f'/api?entityschema={schema}&entity=Q100532807&language=en',
follow_redirects=True)
self.assertEqual(response.status_code, 200)
Expand Down Expand Up @@ -319,18 +318,7 @@ def test_entityschema_e351(self):
"""
response = self.app.get('/api?entityschema=E351&entity=Q743656&language=en',
follow_redirects=True)
self.assertIn(response.json["properties"]["P31"]["response"], ["incorrect"])

def test_entityschema_e351_2(self):
"""
Tests that blank schemas doesn't fail
This test tests entityschema E351 (pharmaceutical product) against entity Q29006691 (Xgeva).
P31 should return as too many statements
"""
response = self.app.get('/api?entityschema=E351&entity=Q29006691&language=en',
follow_redirects=True)
self.assertIn(response.json["properties"]["P31"]["response"], ["too many statements"])
self.assertIn(response.json["properties"]["P31"]["response"], ["not enough correct statements"])


if __name__ == '__main__':
Expand Down

0 comments on commit 5120ca8

Please sign in to comment.