|
5 | 5 |
|
6 | 6 | from pydantic import ValidationError |
7 | 7 |
|
8 | | -from aind_data_schema.device import Calibration |
| 8 | +from aind_data_schema.device import Calibration, DAQChannel |
9 | 9 | from aind_data_schema.imaging import acquisition as acq |
10 | 10 | from aind_data_schema.imaging import instrument as inst |
11 | 11 | from aind_data_schema.imaging import mri_session as ms |
12 | 12 | from aind_data_schema.imaging import tile |
13 | 13 | from aind_data_schema.manufacturers import Manufacturer |
14 | 14 | from aind_data_schema.processing import Registration |
15 | 15 | from aind_data_schema.utils.units import PowerValue |
| 16 | +from aind_data_schema.rig import NeuropixelsBasestation |
16 | 17 |
|
17 | 18 |
|
18 | 19 | class ImagingTests(unittest.TestCase): |
@@ -187,6 +188,51 @@ def test_registration(self): |
187 | 188 |
|
188 | 189 | assert t is not None |
189 | 190 |
|
| 191 | + def test_validators(self): |
| 192 | + |
| 193 | + with self.assertRaises(ValidationError): |
| 194 | + inst.Instrument( |
| 195 | + instrument_type="diSPIM", |
| 196 | + modification_date=datetime.datetime.now(), |
| 197 | + manufacturer=Manufacturer.LIFECANVAS, |
| 198 | + objectives=[], |
| 199 | + detectors=[], |
| 200 | + light_sources=[], |
| 201 | + daqs=[ |
| 202 | + NeuropixelsBasestation( |
| 203 | + basestation_firmware_version="1", |
| 204 | + bsc_firmware_version="2", |
| 205 | + slot=0, |
| 206 | + manufacturer=Manufacturer.IMEC, |
| 207 | + ports=[], |
| 208 | + computer_name="foo", |
| 209 | + channels=[ |
| 210 | + DAQChannel( |
| 211 | + channel_name="123", |
| 212 | + device_name="Laser A", |
| 213 | + channel_type="Analog Output", |
| 214 | + ), |
| 215 | + DAQChannel( |
| 216 | + channel_name="321", |
| 217 | + device_name="Probe A", |
| 218 | + channel_type="Analog Output", |
| 219 | + ), |
| 220 | + DAQChannel( |
| 221 | + channel_name="234", |
| 222 | + device_name="Camera A", |
| 223 | + channel_type="Digital Output", |
| 224 | + ), |
| 225 | + DAQChannel( |
| 226 | + channel_name="2354", |
| 227 | + device_name="Disc A", |
| 228 | + channel_type="Digital Output", |
| 229 | + ), |
| 230 | + ], |
| 231 | + ), |
| 232 | + ] |
| 233 | + ) |
| 234 | + |
| 235 | + |
190 | 236 |
|
191 | 237 | if __name__ == "__main__": |
192 | 238 | unittest.main() |
0 commit comments