Skip to content

Commit

Permalink
refactor: add missing type hints
Browse files Browse the repository at this point in the history
  • Loading branch information
Szymon Palucha committed Oct 3, 2024
1 parent e77ec0a commit 1fc300f
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions kazu/tests/test_ontology_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def setup_databases(
return SynonymDatabase()


def test_should_add_resource_to_parser(tmp_path) -> None:
def test_should_add_resource_to_parser(tmp_path: Path) -> None:
resource = OntologyStringResource(
original_synonyms=frozenset(
[
Expand Down Expand Up @@ -165,7 +165,7 @@ def test_should_add_resource_to_parser(tmp_path) -> None:
assert len(syn_db.get_all(PARSER_1_NAME)) == len(syn_db.get_all(NOOP_PARSER_NAME)) + 1


def test_should_drop_from_parser_via_general_rule(tmp_path) -> None:
def test_should_drop_from_parser_via_general_rule(tmp_path: Path) -> None:
global_actions = GlobalParserActions(
actions=[
ParserAction(
Expand All @@ -187,7 +187,7 @@ def test_should_drop_from_parser_via_general_rule(tmp_path) -> None:
assert len(syn_db.get_all(PARSER_1_NAME)) + 2 == len(syn_db.get_all(NOOP_PARSER_NAME))


def test_should_modify_resource_from_parser_via_general_rule(tmp_path) -> None:
def test_should_modify_resource_from_parser_via_general_rule(tmp_path: Path) -> None:
# note, this test is similar to test_should_drop_from_parser_via_general_rule,
# although it tests that a OntologyStringResource is also affected by a general rule
global_actions = GlobalParserActions(
Expand Down Expand Up @@ -249,7 +249,7 @@ def test_should_modify_resource_from_parser_via_general_rule(tmp_path) -> None:
assert len(syn_db.get_syns_for_id(PARSER_1_NAME, "first")) == 0


def test_should_not_add_a_resource_as_id_nonexistant(tmp_path) -> None:
def test_should_not_add_a_resource_as_id_nonexistant(tmp_path: Path) -> None:
override_id = "I do not exist"
resource = OntologyStringResource(
original_synonyms=frozenset(
Expand Down Expand Up @@ -291,7 +291,7 @@ def test_should_not_add_a_resource_as_id_nonexistant(tmp_path) -> None:
assert override_id not in modified_equivalent_ids


def test_should_override_id_set(tmp_path) -> None:
def test_should_override_id_set(tmp_path: Path) -> None:
resource = OntologyStringResource(
original_synonyms=frozenset(
[
Expand Down Expand Up @@ -332,7 +332,7 @@ def test_should_override_id_set(tmp_path) -> None:
assert "second" in equiv_id_set.ids


def test_should_not_add_a_resource_to_db_as_one_already_exists(tmp_path) -> None:
def test_should_not_add_a_resource_to_db_as_one_already_exists(tmp_path: Path) -> None:
resource = OntologyStringResource(
original_synonyms=frozenset(
[
Expand Down Expand Up @@ -369,7 +369,7 @@ def test_should_not_add_a_resource_to_db_as_one_already_exists(tmp_path) -> None
assert len(syn_db.get_all(PARSER_1_NAME)) == len(syn_db.get_all(NOOP_PARSER_NAME))


def test_should_not_add_a_resource_as_can_infer_associated_id_sets(tmp_path) -> None:
def test_should_not_add_a_resource_as_can_infer_associated_id_sets(tmp_path: Path) -> None:
resource = OntologyStringResource(
original_synonyms=frozenset(
[
Expand All @@ -392,7 +392,7 @@ def test_should_not_add_a_resource_as_can_infer_associated_id_sets(tmp_path) ->
assert len(syn_db.get_all(PARSER_1_NAME)) == len(syn_db.get_all(NOOP_PARSER_NAME))


def test_conflicting_overrides_in_associated_id_sets(tmp_path) -> None:
def test_conflicting_overrides_in_associated_id_sets(tmp_path: Path) -> None:
resource1 = OntologyStringResource(
original_synonyms=frozenset(
[
Expand Down Expand Up @@ -453,7 +453,7 @@ def test_conflicting_overrides_in_associated_id_sets(tmp_path) -> None:
)


def test_gene_ontology_caching(tmp_path) -> None:
def test_gene_ontology_caching(tmp_path: Path) -> None:
micro_graph = """
@prefix : <https://www.example.org> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
Expand Down

0 comments on commit 1fc300f

Please sign in to comment.