Skip to content
This repository has been archived by the owner on Nov 18, 2023. It is now read-only.

Commit

Permalink
Fix end-to-end test (#146)
Browse files Browse the repository at this point in the history
## 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
  • Loading branch information
jmsfltchr authored Aug 18, 2020
1 parent 8eb1b81 commit 2d4c85a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 13 deletions.
14 changes: 2 additions & 12 deletions kglib/utils/grakn/type/type.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,7 @@ def get_thing_types(tx):
Returns:
Grakn types
"""
schema_concepts = tx.query(
"match $x sub thing; "
"not {$x sub @has-attribute;}; "
"not {$x sub @key-attribute;}; "
"get;")
schema_concepts = tx.query("match $x sub thing; get;")
thing_types = [schema_concept.get('x').label() for schema_concept in schema_concepts]
[thing_types.remove(el) for el in ['thing', 'relation', 'entity', 'attribute']]
return thing_types
Expand All @@ -46,13 +42,7 @@ def get_role_types(tx):
Returns:
Grakn roles
"""
schema_concepts = tx.query(
"match $x sub role; "
"not{$x sub @key-attribute-value;}; "
"not{$x sub @key-attribute-owner;}; "
"not{$x sub @has-attribute-value;}; "
"not{$x sub @has-attribute-owner;};"
"get;")
schema_concepts = tx.query("match $x sub role; get;")
role_types = ['has'] + [role.get('x').label() for role in schema_concepts]
role_types.remove('role')
return role_types
2 changes: 1 addition & 1 deletion tests/end_to_end/kgcn/diagnosis.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,4 @@ def test_learning_is_done(self):
if __name__ == "__main__":
# This handles the fact that additional arguments that are supplied by our py_test definition
# https://stackoverflow.com/a/38012249
unittest.main(argv=['ignored-arg'], exit=False)
unittest.main(argv=['ignored-arg'])

0 comments on commit 2d4c85a

Please sign in to comment.