Skip to content

Commit

Permalink
prune back
Browse files Browse the repository at this point in the history
  • Loading branch information
bdworth committed Jan 29, 2024
1 parent 7f9ebc9 commit d3dfc27
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@

from allotropy.parser_factory import Vendor
from tests.parsers.test_utils import (
CALCULATED_DATA_IDENTIFIER,
DATA_SOURCE_IDENTIFIER,
from_file,
MEASUREMENT_IDENTIFIER,
validate_contents,
validate_schema,
)
Expand All @@ -19,17 +16,11 @@
TESTDATA = "tests/parsers/example_weyland_yutani/testdata"
VENDOR_TYPE = Vendor.EXAMPLE_WEYLAND_YUTANI

IDENTIFIERS_TO_EXCLUDE = [
CALCULATED_DATA_IDENTIFIER,
DATA_SOURCE_IDENTIFIER,
MEASUREMENT_IDENTIFIER,
]


@pytest.mark.parametrize("filestem", valid_files)
def test_parse_weyland_yutani_to_asm(filestem: str) -> None:
test_filepath = f"{TESTDATA}/{filestem}.csv"
expected_filepath = f"{TESTDATA}/{filestem}.json"
allotrope_dict = from_file(test_filepath, VENDOR_TYPE)
validate_schema(allotrope_dict, SCHEMA)
validate_contents(allotrope_dict, expected_filepath, IDENTIFIERS_TO_EXCLUDE)
validate_contents(allotrope_dict, expected_filepath)
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
from allotropy.parsers.utils.timestamp_parser import TimestampParser
from tests.parsers.roche_cedex_bioht.roche_cedex_bioht_data import get_data, get_model
from tests.parsers.test_utils import (
CALCULATED_DATA_IDENTIFIER,
DATA_SOURCE_IDENTIFIER,
from_file,
MEASUREMENT_IDENTIFIER,
validate_contents,
Expand All @@ -26,8 +24,6 @@
SCHEMA_FILE = "cell-culture-analyzer/BENCHLING/2023/09/cell-culture-analyzer.json"

IDENTIFIERS_TO_EXCLUDE = [
CALCULATED_DATA_IDENTIFIER,
DATA_SOURCE_IDENTIFIER,
MEASUREMENT_IDENTIFIER,
]

Expand Down
2 changes: 1 addition & 1 deletion tests/parsers/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def validate_schema(allotrope_dict: DictType, schema_relative_path: str) -> None
def validate_contents(
allotrope_dict: DictType,
expected_file: str,
identifiers_to_exclude: list[str],
identifiers_to_exclude: Optional[list[str]] = None,
) -> None:
"""Use the newly created allotrope_dict to validate the contents inside expected_file."""
with open(expected_file) as f:
Expand Down

0 comments on commit d3dfc27

Please sign in to comment.