Skip to content

Commit 2d4c85a

Browse files
authored
Fix end-to-end test (typedb#146)
## What is the goal of this PR? We fix the end-to-end test to properly report failure ## What are the changes implemented in this PR? - Remove incorrect and unneeded parameter supplied to unittest - This uncovers that `@has-attribute` and friends no longer exist in Grakn 1.8.0, so they are removed
1 parent 8eb1b81 commit 2d4c85a

File tree

2 files changed

+3
-13
lines changed

2 files changed

+3
-13
lines changed

kglib/utils/grakn/type/type.py

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,7 @@ def get_thing_types(tx):
2727
Returns:
2828
Grakn types
2929
"""
30-
schema_concepts = tx.query(
31-
"match $x sub thing; "
32-
"not {$x sub @has-attribute;}; "
33-
"not {$x sub @key-attribute;}; "
34-
"get;")
30+
schema_concepts = tx.query("match $x sub thing; get;")
3531
thing_types = [schema_concept.get('x').label() for schema_concept in schema_concepts]
3632
[thing_types.remove(el) for el in ['thing', 'relation', 'entity', 'attribute']]
3733
return thing_types
@@ -46,13 +42,7 @@ def get_role_types(tx):
4642
Returns:
4743
Grakn roles
4844
"""
49-
schema_concepts = tx.query(
50-
"match $x sub role; "
51-
"not{$x sub @key-attribute-value;}; "
52-
"not{$x sub @key-attribute-owner;}; "
53-
"not{$x sub @has-attribute-value;}; "
54-
"not{$x sub @has-attribute-owner;};"
55-
"get;")
45+
schema_concepts = tx.query("match $x sub role; get;")
5646
role_types = ['has'] + [role.get('x').label() for role in schema_concepts]
5747
role_types.remove('role')
5848
return role_types

tests/end_to_end/kgcn/diagnosis.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,4 @@ def test_learning_is_done(self):
4949
if __name__ == "__main__":
5050
# This handles the fact that additional arguments that are supplied by our py_test definition
5151
# https://stackoverflow.com/a/38012249
52-
unittest.main(argv=['ignored-arg'], exit=False)
52+
unittest.main(argv=['ignored-arg'])

0 commit comments

Comments
 (0)