def test_electrode_group_factory_create_ElectrodeGroup_successfully(self): mock_probe = Mock(spec=Probe) mock_device = Mock(spec=Device) mock_fl_electrode_group_1 = Mock(spec=FlElectrodeGroup) mock_fl_electrode_group_1.name = '0' mock_fl_electrode_group_1.description = 'ElectrodeGroup 1' mock_fl_electrode_group_1.location = 'mPFC' mock_fl_electrode_group_1.device = mock_probe mock_fl_electrode_group_2 = Mock(spec=FlElectrodeGroup) mock_fl_electrode_group_2.name = '1' mock_fl_electrode_group_2.description = 'ElectrodeGroup 2' mock_fl_electrode_group_2.location = 'mPFC' mock_fl_electrode_group_2.device = mock_device electrode_group_1 = ElectrodeGroupFactory.create_electrode_group( mock_fl_electrode_group_1) electrode_group_2 = ElectrodeGroupFactory.create_electrode_group( mock_fl_electrode_group_2) self.assertIsNotNone(electrode_group_1) self.assertIsNotNone(electrode_group_2) self.assertEqual(electrode_group_1.name, "0") self.assertEqual(electrode_group_1.description, 'ElectrodeGroup 1') self.assertEqual(electrode_group_1.location, 'mPFC') self.assertEqual(electrode_group_1.device, mock_probe) self.assertEqual(electrode_group_2.name, '1') self.assertEqual(electrode_group_2.description, 'ElectrodeGroup 2') self.assertEqual(electrode_group_2.location, 'mPFC') self.assertEqual(electrode_group_2.device, mock_device)
def test_electrode_group_factory_failed_creating_ElectrodeGroup_due_to_lack_of_FlElectrodeGroup_attr( self): mock_fl_electrode_group_1 = Mock(spec=FlElectrodeGroup) mock_fl_electrode_group_1.name = 'ElectrodeGroup 1' mock_fl_electrode_group_1.description = 'sample desciption 1' mock_fl_electrode_group_1.location = 'sample location 1' mock_fl_electrode_group_1.device = None ElectrodeGroupFactory.create_electrode_group(mock_fl_electrode_group_1)
def test_electrode_group_factory_failed_creating_ElectrodeGroup_due_to_lack_of_FLElectrodeGroup( self): ElectrodeGroupFactory.create_electrode_group(None)