Skip to content

Commit 74a120e

Browse files
DataAcqDevice
1 parent 6f62b5f commit 74a120e

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

src/pynwb/tests/test_read_nwb.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
from pynwb.device import Device
1010
from pynwb.testing import TestCase
1111

12+
from src.pynwb.ndx_franklab_novela.data_acq_device import DataAcqDevice
1213
from src.pynwb.ndx_franklab_novela.header_device import HeaderDevice
1314
from src.pynwb.ndx_franklab_novela.nwb_electrode_group import NwbElectrodeGroup
1415
from src.pynwb.ndx_franklab_novela.probe import Probe, Shank, ShanksElectrode
@@ -95,6 +96,26 @@ def test_read_nwb_probe_successfully(self):
9596

9697
self.delete_nwb('probe')
9798

99+
def test_read_nwb_data_acq_device_successfully(self):
100+
data_acq_device = DataAcqDevice(
101+
name='DataAcqDevice1',
102+
system='System1',
103+
amplifier='Amplifier1',
104+
adc_circuit='adc_circuit1'
105+
)
106+
self.nwb_file_content.add_device(data_acq_device)
107+
108+
nwb_file_handler = NWBHDF5IO('data_acq_device.nwb', mode='w')
109+
nwb_file_handler.write(self.nwb_file_content)
110+
nwb_file_handler.close()
111+
112+
self.assertTrue(os.path.exists('data_acq_device.nwb'))
113+
with pynwb.NWBHDF5IO('data_acq_device.nwb', 'r', load_namespaces=True) as nwb_file_handler:
114+
nwb_file = nwb_file_handler.read()
115+
self.assertContainerEqual(nwb_file.devices['DataAcqDevice1'], data_acq_device)
116+
117+
self.delete_nwb('data_acq_device')
118+
98119
def test_read_nwb_nwb_electrode_group_successfully(self):
99120
device = Device('device_0')
100121
self.nwb_file_content.add_device(device)

0 commit comments

Comments
 (0)