Skip to content

Commit

Permalink
Merge pull request #1561 from PeterNSteinmetz/TestNlxHeader
Browse files Browse the repository at this point in the history
Add back in test of file using props_only option.
  • Loading branch information
zm711 authored Sep 20, 2024
2 parents 7d90ba9 + 214f3a0 commit d417a11
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions neo/test/rawiotest/test_neuralynxrawio.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,20 +360,18 @@ def test_equality(self):
ns0.sampFreqUsed = 400
self.assertNotEqual(ns0, ns1)

class TestNlxHeader(TestNeuralynxRawIO, unittest.TestCase):
def test_no_date_time(self):
filename = self.get_local_path("neuralynx/NoDateHeader/NoDateHeader.nev")

# I comment this now and will put it back when files will be in gin.g-node
# class TestNlxHeader(TestNeuralynxRawIO, unittest.TestCase):
# def test_no_date_time(self):
# filename = self.get_local_path("neuralynx/NoDateHeader/NoDateHeader.nev")

# with self.assertRaises(IOError):
# hdr = NlxHeader(filename)
with self.assertRaises(IOError):
hdr = NlxHeader(filename)

# hdr = NlxHeader(filename, props_only=True)
hdr = NlxHeader(filename, props_only=True)

# self.assertEqual(len(hdr), 11)
# self.assertEqual(hdr['ApplicationName'], 'Pegasus')
# self.assertEqual(hdr['FileType'], 'Event')
self.assertEqual(len(hdr), 11) # 9 properties plus channel_ids and channel_names
self.assertEqual(hdr['ApplicationName'], 'Pegasus')
self.assertEqual(hdr['FileType'], 'Event')

if __name__ == "__main__":
unittest.main()
Expand Down

0 comments on commit d417a11

Please sign in to comment.