-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: backward compatible refactor "sitmulus_name" in AuditoryStimulat…
…ion (#1144) * fix: backward compatible refactor "sitmulus_name" in AuditoryStimulation * chore: docstring * fix: replace field_validator with model_validator * chore: lint
- Loading branch information
Showing
2 changed files
with
30 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
"""Test components.stimulus""" | ||
|
||
import unittest | ||
from aind_data_schema.components.stimulus import AuditoryStimulation | ||
|
||
|
||
class StimulusTests(unittest.TestCase): | ||
"""tests components.stimulus""" | ||
|
||
def test_typo(self): | ||
"""tests that the sitmulus typo is corrected""" | ||
a = AuditoryStimulation( | ||
stimulus_type="Auditory Stimulation", | ||
stimulus_name="test", | ||
sample_frequency=0.5, | ||
) | ||
|
||
a_dict = a.model_dump() | ||
a_dict["sitmulus_name"] = a_dict.pop("stimulus_name") | ||
|
||
self.assertEqual(a.model_dump(), AuditoryStimulation(**a_dict).model_dump()) |