Skip to content

Commit

Permalink
update test inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
stephprince committed Jun 27, 2024
1 parent 679ea03 commit 7cdec94
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
28 changes: 28 additions & 0 deletions tests/integration/hdf5/test_nwbfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ def setUp(self):
session_id='007',
slices='noslices',
source_script='nosources',
was_generated_by=[('nosoftware', '0.0.0')],
surgery='nosurgery',
virus='novirus',
source_script_file_name='nofilename')
Expand Down Expand Up @@ -128,6 +129,7 @@ def build_nwbfile(self):
virus='a virus',
source_script='noscript',
source_script_file_name='nofilename',
was_generated_by=[('nosoftware', '0.0.0')],
stimulus_notes='test stimulus notes',
data_collection='test data collection notes',
keywords=('these', 'are', 'keywords'))
Expand Down Expand Up @@ -176,6 +178,32 @@ def build_nwbfile(self):
self.nwbfile.experimenter = ('experimenter1', 'experimenter2')


class TestWasGeneratedByConstructorRoundtrip(TestNWBFileIO):
""" Test that a list of software packages / versions in a constructor is written to and read from file """

def build_nwbfile(self):
description = 'test nwbfile was_generated_by'
identifier = 'TEST_was_generated_by'
self.nwbfile = NWBFile(session_description=description,
identifier=identifier,
session_start_time=self.start_time,
was_generated_by=[('software1', '0.1.0'),
('software2', '0.2.0'),
('software3', '0.3.0')],)

class TestWasGeneratedBySetterRoundtrip(TestNWBFileIO):
""" Test that a single tuple of software versions packages in a setter is written to and read from file """

def build_nwbfile(self):
description = 'test nwbfile was_generated_by'
identifier = 'TEST_was_generated_by'
self.nwbfile = NWBFile(session_description=description,
identifier=identifier,
session_start_time=self.start_time)
self.nwbfile.was_generated_by = [('software1', '0.1.0'),
('software2', '0.2.0'),
('software3', '0.3.0')]

class TestPublicationsConstructorRoundtrip(TestNWBFileIO):
""" Test that a list of multiple publications in a constructor is written to and read from file """

Expand Down
2 changes: 2 additions & 0 deletions tests/unit/test_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ def setUp(self):
virus='a virus',
source_script='noscript',
source_script_file_name='nofilename',
was_generated_by=[('nosoftware', '0.0.0')],
stimulus_notes='test stimulus notes',
data_collection='test data collection notes',
keywords=('these', 'are', 'keywords'))
Expand All @@ -61,6 +62,7 @@ def test_constructor(self):
self.assertEqual(self.nwbfile.related_publications, ('my pubs',))
self.assertEqual(self.nwbfile.source_script, 'noscript')
self.assertEqual(self.nwbfile.source_script_file_name, 'nofilename')
self.assertEqual(self.nwbfile.was_generated_by, [('nosoftware', '0.0.0')])
self.assertEqual(self.nwbfile.keywords, ('these', 'are', 'keywords'))
self.assertEqual(self.nwbfile.timestamps_reference_time, self.ref_time)

Expand Down

0 comments on commit 7cdec94

Please sign in to comment.