Skip to content

Commit

Permalink
tests: Value->ValidationError
Browse files Browse the repository at this point in the history
  • Loading branch information
dbirman committed Oct 9, 2024
1 parent fa756cb commit 354f6cf
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/test_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def test_validate_smartspim_metadata(self):

# Tests missing metadata
surgery1 = Surgery.model_construct(procedures=[nano_inj, ionto_inj])
with self.assertRaises(ValueError) as context:
with self.assertRaises(ValidationError) as context:
Metadata(
name="ecephys_655019_2023-04-03_18-17-09",
location="bucket",
Expand All @@ -156,7 +156,7 @@ def test_validate_smartspim_metadata(self):

# Tests excluded metadata getting included
surgery1 = Surgery.model_construct(procedures=[nano_inj, ionto_inj])
with self.assertRaises(ValueError) as context:
with self.assertRaises(ValidationError) as context:
Metadata(
name="ecephys_655019_2023-04-03_18-17-09",
location="bucket",
Expand All @@ -178,7 +178,7 @@ def test_validate_smartspim_metadata(self):

# Tests missing injection materials
surgery2 = Surgery.model_construct(procedures=[nano_inj])
with self.assertRaises(ValueError) as context:
with self.assertRaises(ValidationError) as context:
Metadata(
name="ecephys_655019_2023-04-03_18-17-09",
location="bucket",
Expand Down Expand Up @@ -235,7 +235,7 @@ def test_validate_ecephys_metadata(self):

# Tests missing metadata
surgery1 = Surgery.model_construct(procedures=[nano_inj, ionto_inj])
with self.assertRaises(ValueError) as context:
with self.assertRaises(ValidationError) as context:
Metadata(
name="ecephys_655019_2023-04-03_18-17-09",
location="bucket",
Expand All @@ -255,7 +255,7 @@ def test_validate_ecephys_metadata(self):

# Tests missing injection materials
surgery2 = Surgery.model_construct(procedures=[nano_inj])
with self.assertRaises(ValueError) as context:
with self.assertRaises(ValidationError) as context:
Metadata(
name="ecephys_655019_2023-04-03_18-17-09",
location="bucket",
Expand Down Expand Up @@ -305,7 +305,7 @@ def test_validate_rig_session_compatibility(self):
mouse_platform = MousePlatform.model_construct(name="platform1")
rig = Rig.model_construct(rig_id="123_EPHYS1_20220101", mouse_platform=mouse_platform)
session = Session.model_construct(rig_id="123_EPHYS2_20230101", mouse_platform_name="platform2")
with self.assertRaises(ValueError) as context:
with self.assertRaises(ValidationError) as context:
Metadata(
name="ecephys_655019_2023-04-03_18-17-09",
location="bucket",
Expand Down

0 comments on commit 354f6cf

Please sign in to comment.