-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2a80ebd
commit c8f17c4
Showing
11 changed files
with
402 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
Copyright 2020, NovelaNeurotechnologies | ||
|
||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: | ||
|
||
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. | ||
|
||
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. | ||
|
||
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | ||
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; | ||
OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
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
Empty file.
Empty file.
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
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,45 @@ | ||
from unittest import TestCase | ||
from unittest.mock import Mock | ||
|
||
from src.pynwb.ndx_novela_namespace.apparatus import Apparatus | ||
from src.pynwb.ndx_novela_namespace.edge import Edge | ||
from src.pynwb.ndx_novela_namespace.node import Node | ||
|
||
|
||
class TestApparatus(TestCase): | ||
@classmethod | ||
def setUpClass(cls): | ||
cls.node_1 = Mock() | ||
cls.node_1.__class__ = Node | ||
cls.node_2 = Mock() | ||
cls.node_2.__class__ = Node | ||
|
||
cls.node_3 = Mock() | ||
cls.node_3.__class__ = Node | ||
cls.node_4 = Mock() | ||
cls.node_4.__class__ = Node | ||
|
||
cls.edge_1 = Mock() | ||
cls.edge_1.__class__ = Edge | ||
cls.edge_2 = Mock() | ||
cls.edge_2.__class__ = Edge | ||
|
||
cls.apparatus = Apparatus( | ||
name='ApparatusName', | ||
edges=[cls.edge_1, cls.edge_2], | ||
nodes=[cls.node_1, cls.node_2, cls.node_3, cls.node_4] | ||
) | ||
|
||
def test_successfulEdgeCreation_true(self): | ||
self.assertIsInstance(self.apparatus, Apparatus) | ||
|
||
def test_checkEdgeCorrectValue_true(self): | ||
self.assertEqual(self.apparatus.name, 'ApparatusName') | ||
self.assertEqual(self.apparatus.edges, {self.edge_1.name: self.edge_1, self.edge_2.name: self.edge_2}) | ||
self.assertEqual(self.apparatus.nodes, {self.node_1.name: self.node_1, self.node_2.name: self.node_2, | ||
self.node_3.name: self.node_3, self.node_4.name: self.node_4}) | ||
|
||
def test_checkEdgeCorrectType_true(self): | ||
self.assertIsInstance(self.apparatus.name, str) | ||
self.assertIsInstance(self.apparatus.edges, dict) | ||
self.assertIsInstance(self.apparatus.nodes, dict) |
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,39 @@ | ||
import unittest | ||
from unittest.mock import Mock | ||
|
||
from pynwb.device import Device | ||
|
||
from src.pynwb.ndx_novela_namespace.fl_electrode_group import FLElectrodeGroup | ||
|
||
|
||
class TestFLElectrodeGroup(unittest.TestCase): | ||
|
||
@classmethod | ||
def setUpClass(cls): | ||
cls.mock_device = Mock() | ||
cls.mock_device.__class__ = Device | ||
|
||
cls.fl_electrode_group = FLElectrodeGroup( | ||
name='FLElectrodeGroup1', | ||
id=1, | ||
description='Sample description', | ||
location='Sample location', | ||
device=cls.mock_device, | ||
) | ||
|
||
def test_successfulNodeCreation_true(self): | ||
self.assertIsInstance(self.fl_electrode_group, FLElectrodeGroup) | ||
|
||
def test_checkNodeCorrectValue_true(self): | ||
self.assertEqual(self.fl_electrode_group.name, 'FLElectrodeGroup1') | ||
self.assertEqual(self.fl_electrode_group.description, 'Sample description') | ||
self.assertEqual(self.fl_electrode_group.location, 'Sample location') | ||
self.assertEqual(self.fl_electrode_group.device, self.mock_device) | ||
self.assertEqual(self.fl_electrode_group.id, 1) | ||
|
||
def test_checkNodeCorrectType_true(self): | ||
self.assertIsInstance(self.fl_electrode_group.name, str) | ||
self.assertIsInstance(self.fl_electrode_group.description, str) | ||
self.assertIsInstance(self.fl_electrode_group.location, str) | ||
self.assertIsInstance(self.fl_electrode_group.device, Device) | ||
self.assertIsInstance(self.fl_electrode_group.id, int) |
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,81 @@ | ||
from unittest import TestCase | ||
|
||
from src.pynwb.ndx_novela_namespace.header_device import HeaderDevice | ||
|
||
|
||
class TestHeaderDevice(TestCase): | ||
|
||
@classmethod | ||
def setUpClass(cls): | ||
cls.header_device = HeaderDevice( | ||
name='HeaderDevice1', | ||
headstage_serial='Sample headstage_serial', | ||
headstage_smart_ref_on='Sample headstage_smart_ref_on', | ||
realtime_mode='Sample realtime_mode', | ||
headstage_auto_settle_on='Sample headstage_auto_settle_on', | ||
timestamp_at_creation='Sample timestamp_at_creation', | ||
controller_firmware_version='Sample controller_firmware_version', | ||
controller_serial='Sample controller_serial', | ||
save_displayed_chan_only='Sample save_displayed_chan_only', | ||
headstage_firmware_version='Sample headstage_firmware_version', | ||
qt_version='Sample qt_version', | ||
compile_date='Sample compile_date', | ||
compile_time='Sample compile_time', | ||
file_prefix='Sample file_prefix', | ||
headstage_gyro_sensor_on='Sample headstage_gyro_sensor_on', | ||
headstage_mag_sensor_on='Sample headstage_mag_sensor_on', | ||
trodes_version='Sample trodes_version', | ||
headstage_accel_sensor_on='Sample headstage_accel_sensor_on', | ||
commit_head='Sample commit_head', | ||
system_time_at_creation='Sample system_time_at_creation', | ||
file_path='Sample file_path', | ||
) | ||
|
||
def test_successfulNodeCreation_true(self): | ||
self.assertIsInstance(self.header_device, HeaderDevice) | ||
|
||
def test_checkNodeCorrectValue_true(self): | ||
self.assertEqual(self.header_device.name, 'HeaderDevice1') | ||
self.assertEqual(self.header_device.headstage_serial, 'Sample headstage_serial') | ||
self.assertEqual(self.header_device.headstage_smart_ref_on, 'Sample headstage_smart_ref_on') | ||
self.assertEqual(self.header_device.realtime_mode, 'Sample realtime_mode') | ||
self.assertEqual(self.header_device.headstage_auto_settle_on, 'Sample headstage_auto_settle_on') | ||
self.assertEqual(self.header_device.timestamp_at_creation, 'Sample timestamp_at_creation') | ||
self.assertEqual(self.header_device.controller_firmware_version, 'Sample controller_firmware_version') | ||
self.assertEqual(self.header_device.controller_serial, 'Sample controller_serial') | ||
self.assertEqual(self.header_device.save_displayed_chan_only, 'Sample save_displayed_chan_only') | ||
self.assertEqual(self.header_device.headstage_firmware_version, 'Sample headstage_firmware_version') | ||
self.assertEqual(self.header_device.qt_version, 'Sample qt_version') | ||
self.assertEqual(self.header_device.compile_date, 'Sample compile_date') | ||
self.assertEqual(self.header_device.compile_time, 'Sample compile_time') | ||
self.assertEqual(self.header_device.file_prefix, 'Sample file_prefix') | ||
self.assertEqual(self.header_device.headstage_gyro_sensor_on, 'Sample headstage_gyro_sensor_on') | ||
self.assertEqual(self.header_device.headstage_mag_sensor_on, 'Sample headstage_mag_sensor_on') | ||
self.assertEqual(self.header_device.trodes_version, 'Sample trodes_version') | ||
self.assertEqual(self.header_device.headstage_accel_sensor_on, 'Sample headstage_accel_sensor_on') | ||
self.assertEqual(self.header_device.commit_head, 'Sample commit_head') | ||
self.assertEqual(self.header_device.system_time_at_creation, 'Sample system_time_at_creation') | ||
self.assertEqual(self.header_device.file_path, 'Sample file_path') | ||
|
||
def test_checkNodeCorrectType_true(self): | ||
self.assertEqual(self.header_device.name, 'HeaderDevice1') | ||
self.assertIsInstance(self.header_device.headstage_serial, str) | ||
self.assertIsInstance(self.header_device.headstage_smart_ref_on, str) | ||
self.assertIsInstance(self.header_device.realtime_mode, str) | ||
self.assertIsInstance(self.header_device.headstage_auto_settle_on, str) | ||
self.assertIsInstance(self.header_device.timestamp_at_creation, str) | ||
self.assertIsInstance(self.header_device.controller_firmware_version, str) | ||
self.assertIsInstance(self.header_device.controller_serial, str) | ||
self.assertIsInstance(self.header_device.save_displayed_chan_only, str) | ||
self.assertIsInstance(self.header_device.headstage_firmware_version, str) | ||
self.assertIsInstance(self.header_device.qt_version, str) | ||
self.assertIsInstance(self.header_device.compile_date, str) | ||
self.assertIsInstance(self.header_device.compile_time, str) | ||
self.assertIsInstance(self.header_device.file_prefix, str) | ||
self.assertIsInstance(self.header_device.headstage_gyro_sensor_on, str) | ||
self.assertIsInstance(self.header_device.headstage_mag_sensor_on, str) | ||
self.assertIsInstance(self.header_device.trodes_version, str) | ||
self.assertIsInstance(self.header_device.headstage_accel_sensor_on, str) | ||
self.assertIsInstance(self.header_device.commit_head, str) | ||
self.assertIsInstance(self.header_device.system_time_at_creation, str) | ||
self.assertIsInstance(self.header_device.file_path, str) |
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,45 @@ | ||
import unittest | ||
from unittest.mock import Mock | ||
|
||
from pynwb.device import Device | ||
|
||
from src.pynwb.ndx_novela_namespace.ntrode import NTrode | ||
|
||
|
||
class TestNTrode(unittest.TestCase): | ||
|
||
@classmethod | ||
def setUpClass(cls): | ||
cls.mock_device = Mock() | ||
cls.mock_device.__class__ = Device | ||
|
||
cls.ntrode = NTrode( | ||
name='NTrode1', | ||
description='Sample description', | ||
location='Sample location', | ||
device=cls.mock_device, | ||
ntrode_id=1, | ||
probe_id=1, | ||
map=[[1, 2], [3, 4], [5, 6]] | ||
) | ||
|
||
def test_successfulNodeCreation_true(self): | ||
self.assertIsInstance(self.ntrode, NTrode) | ||
|
||
def test_checkNodeCorrectValue_true(self): | ||
self.assertEqual(self.ntrode.name, 'NTrode1') | ||
self.assertEqual(self.ntrode.description, 'Sample description') | ||
self.assertEqual(self.ntrode.location, 'Sample location') | ||
self.assertEqual(self.ntrode.device, self.mock_device) | ||
self.assertEqual(self.ntrode.ntrode_id, 1) | ||
self.assertEqual(self.ntrode.probe_id, 1) | ||
self.assertEqual(self.ntrode.map, [[1, 2], [3, 4], [5, 6]]) | ||
|
||
def test_checkNodeCorrectType_true(self): | ||
self.assertIsInstance(self.ntrode.name, str) | ||
self.assertIsInstance(self.ntrode.description, str) | ||
self.assertIsInstance(self.ntrode.location, str) | ||
self.assertIsInstance(self.ntrode.device, Device) | ||
self.assertIsInstance(self.ntrode.ntrode_id, int) | ||
self.assertIsInstance(self.ntrode.probe_id, int) | ||
self.assertIsInstance(self.ntrode.map, list) |
Oops, something went wrong.