diff --git a/tests/conftest.py b/tests/conftest.py index 82d0758..973556d 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -190,7 +190,7 @@ def test_duplicated_note() -> Note: def test_clean_and_paragraphing_note() -> Note: return Note( """ - This is an example of text with various types of spaces: + This is an example of text with various types of spaces: \tTabs, \u00a0Non-breaking spaces, \u2003Em spaces, \u2002En spaces. Some lines may contain only punctuation and spaces, like this: !? ... - -- ??? @@ -223,7 +223,7 @@ def test_clean_and_paragraphing_note() -> Note: imp:: Penicillin - """ + """ # noqa: UP031 ) diff --git a/tests/test_modelbuilder_config.py b/tests/test_modelbuilder_config.py deleted file mode 100644 index f883b31..0000000 --- a/tests/test_modelbuilder_config.py +++ /dev/null @@ -1,77 +0,0 @@ -from pathlib import Path - -from scripts.miade import MakeConfig, Location, Source, URL - - -def test_parse_training_config_complete(): - reference_cfg_string = """ - tag: a_test_tag - description: A test description - ontology: TEST-CT - model: - location: - path: models/test_model_0123456789.zip - vocab: - location: - path: /path/to/file - cdb: - data: - url: https://github.com/// - meta-models: - - problems: - location: - path: /path/to/file - - meds: - data: - path: /path/to/file - - """ - print(reference_cfg_string) - - cfg = MakeConfig.from_yaml_string(reference_cfg_string) - reference_cfg = MakeConfig( - tag="a_test_tag", - ontology="TEST-CT", - description="A test description", - model=Source(location=Location(location=Path("models/test_model_0123456789.zip"))), - vocab=Source(location=Location(location=Path("/path/to/file"))), - cdb=Source(data=Location(location=URL(path="https://github.com///"))), - meta_models={ - "problems": Source(location=Location(location=Path("/path/to/file"))), - "meds": Source(data=Location(location=Path("/path/to/file"))), - }, - ) - print(reference_cfg) - print(cfg) - assert str(cfg) == str(reference_cfg) - - -def test_parse_training_config_incomplete(): - reference_cfg_string = """ - tag: a_test_tag - description: A test description - ontology: TEST-CT - description: "A test description" - model: - location: - path: models/test_model_0123456789.zip - vocab: - location: - path: /path/to/file - - """ - print(reference_cfg_string) - - cfg = MakeConfig.from_yaml_string(reference_cfg_string) - reference_cfg = MakeConfig( - tag="a_test_tag", - ontology="TEST-CT", - description="A test description", - model=Source(location=Location(location=Path("models/test_model_0123456789.zip"))), - vocab=Source(location=Location(location=Path("/path/to/file"))), - cdb=None, - meta_models={}, - ) - print(reference_cfg) - print(cfg) - assert str(cfg) == str(reference_cfg)