Skip to content

Commit

Permalink
Update test_file.py
Browse files Browse the repository at this point in the history
  • Loading branch information
rly authored Oct 4, 2023
1 parent a0daffa commit 930eef6
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tests/unit/test_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,7 @@ def test_subject_age_duration(self):


class TestCacheSpec(TestCase):
"""Test whether the file can be written and read when caching the spec."""

def setUp(self):
self.path = 'unittest_cached_spec.nwb'
Expand All @@ -535,7 +536,7 @@ def tearDown(self):
remove_test_file(self.path)

def test_simple(self):
nwbfile = NWBFile(' ', ' ',
nwbfile = NWBFile('sess_desc', 'identifier',
datetime.now(tzlocal()),
file_create_date=datetime.now(tzlocal()),
institution='University of California, San Francisco',
Expand All @@ -544,9 +545,11 @@ def test_simple(self):
io.write(nwbfile)
with NWBHDF5IO(self.path, 'r') as reader:
nwbfile = reader.read()
assert nwbfile.session_description == "sess_desc"


class TestNoCacheSpec(TestCase):
"""Test whether the file can be written and read when not caching the spec."""

def setUp(self):
self.path = 'unittest_cached_spec.nwb'
Expand All @@ -555,7 +558,7 @@ def tearDown(self):
remove_test_file(self.path)

def test_simple(self):
nwbfile = NWBFile(' ', ' ',
nwbfile = NWBFile('sess_desc', 'identifier',
datetime.now(tzlocal()),
file_create_date=datetime.now(tzlocal()),
institution='University of California, San Francisco',
Expand All @@ -565,6 +568,7 @@ def test_simple(self):

with NWBHDF5IO(self.path, 'r') as reader:
nwbfile = reader.read()
assert nwbfile.session_description == "sess_desc"


class TestTimestampsRefDefault(TestCase):
Expand Down

0 comments on commit 930eef6

Please sign in to comment.