Skip to content

Commit

Permalink
Fixed test (#723)
Browse files Browse the repository at this point in the history
  • Loading branch information
hrshdhgd authored Apr 1, 2024
1 parent a213b21 commit 8a6dfc3
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
3 changes: 3 additions & 0 deletions src/oaklib/utilities/lexical/synonymizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from typing import Iterable, Iterator, List, Optional, Tuple

from kgcl_schema.datamodel import kgcl
from pronto import Definition

from oaklib.datamodels.synonymizer_datamodel import RuleSet, Synonymizer
from oaklib.datamodels.vocabulary import (
Expand Down Expand Up @@ -69,6 +70,8 @@ def apply_synonymizer_to_terms(
if include_all:
defn = adapter.definition(curie)
if defn:
if isinstance(defn, Definition):
defn = str(defn)
tvs.append(("definition", [defn]))
for scope_pred, aliases in tvs:
if aliases is not None:
Expand Down
4 changes: 0 additions & 4 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -934,10 +934,6 @@ def test_search_local_advanced(self):
logging.error(f"INPUT: {input_arg} code = {result.exit_code}")
logging.error(f"OUTPUT={out}")
logging.error(f"ERR={err}")
if result.exit_code == 1:
import pdb

pdb.set_trace()
self.assertEqual(0, result.exit_code)
logging.info(f"OUTPUT={out}")
logging.info(f"ERR={err}")
Expand Down
6 changes: 2 additions & 4 deletions tests/test_implementations/test_robot_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ def test_basic_ontology_adapter(adapter):
}


@pytest.mark.skip("https://github.com/INCATools/kgcl/issues/64")
def test_patcher(adapter):
changes = [f"rename {BRAIN_SPECIMEN} from 'brain specimen' to 'brain sample'"]
if not isinstance(adapter, PatcherInterface):
Expand All @@ -65,13 +64,12 @@ def test_patcher(adapter):
assert isinstance(change_obj, kgcl.NodeRename)
print("NEW:", change_obj.new_value)
adapter.apply_patch(change_obj)
# adapter.set_label(BRAIN_SPECIMEN, "FOO")
assert adapter.label(BRAIN_SPECIMEN) == "FOO"
assert adapter.label(BRAIN_SPECIMEN) == "brain sample"
if not isinstance(adapter, DumperInterface):
raise ValueError("Adapter does not support dumping")
adapter.dump(SAVED_TEMPLATES, clean=True)
adapter2 = get_adapter(f"robottemplate:{SAVED_TEMPLATES}")
assert adapter2.label(BRAIN_SPECIMEN) == "FOO"
assert adapter2.label(BRAIN_SPECIMEN) == "brain sample"


def test_set_label():
Expand Down
2 changes: 2 additions & 0 deletions tests/test_utilities/test_synonymizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ def test_synonymizer(rule, input, expected):
"the plasma membrane and nucleus, but including other subcellular structures.' "
"to 'All of the contents of a cell excluding the plasma membrane and "
"NUCLEUS, but including other subcellular structures.'"
)
],
),
Expand Down Expand Up @@ -114,4 +115,5 @@ def test_syonymizer_on_terms(ruleset, include_all, terms, expected):
change_str = render(change)
print(change_str)
changes_strs.append(change_str)

assert set(changes_strs) == set(expected)

0 comments on commit 8a6dfc3

Please sign in to comment.