Skip to content

Commit

Permalink
used black
Browse files Browse the repository at this point in the history
  • Loading branch information
mochic committed Dec 12, 2023
1 parent e62db21 commit 27ecdc3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
5 changes: 1 addition & 4 deletions src/aind_metadata_mapper/bergamo/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,7 @@
Session,
Stream,
)
from aind_data_schema.models.devices import (
Detector,
Laser,
)
from aind_data_schema.models.devices import Detector, Laser
from aind_data_schema.models.stimulus import (
PhotoStimulation,
PhotoStimulationGroup,
Expand Down
7 changes: 3 additions & 4 deletions src/aind_metadata_mapper/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,14 @@ def _run_validation_check(model_instance: AindCoreModel) -> None:
Contents from the service response.
"""
try:
model_instance.model_validate(
model_instance.__dict__
)
model_instance.model_validate(model_instance.__dict__)
logging.debug("No validation errors detected.")
except ValidationError:
logging.warning(
"Validation errors were found. This may be due to "
"mismatched versions or data not found in the "
"databases.", exc_info=True,
"databases.",
exc_info=True,
)

def run_job(self) -> None:
Expand Down
5 changes: 3 additions & 2 deletions tests/test_subject.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,8 @@ def test_successful_response(
self.subject_etl.run_job()
mock_write.assert_called_once_with(output_directory=Path("tests"))
mock_log_warn.assert_called_once_with(
self.validation_warning_message, exc_info=True)
self.validation_warning_message, exc_info=True
)

@patch(
"aind_metadata_service.client.AindMetadataServiceClient.get_subject"
Expand Down Expand Up @@ -226,7 +227,7 @@ def test_mocked_validate_model(
mocked_response = self.invalid_response
mocked_response.status_code = StatusCodes.VALID_DATA
mock_api_get.return_value = mocked_response
mock_validate.return_value = (None, None)
# mock_validate.return_value = (None, None)
self.subject_etl.run_job()
mock_write.assert_called_once_with(output_directory=Path("tests"))

Expand Down

0 comments on commit 27ecdc3

Please sign in to comment.