Skip to content

Commit 6aff4ae

Browse files
committed
make test more specific and shorter to get some good old Sam love
1 parent f1b5215 commit 6aff4ae

1 file changed

Lines changed: 2 additions & 23 deletions

File tree

neo/test/rawiotest/test_blackrockrawio.py

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -227,40 +227,19 @@ def test_gap_tolerance_ms_parameter(self):
227227
reader = BlackrockRawIO(filename=dirname, nsx_to_load=6)
228228
reader.parse_header()
229229

230-
# Verify the error message contains gap information
231-
error_msg = str(context.exception)
232-
self.assertIn("gap", error_msg.lower())
233-
self.assertIn("gap_tolerance_ms", error_msg)
234-
self.assertIn("Gap Report", error_msg)
235-
236230
# Test 2: Explicit tolerance allows loading files with gaps
237231
# User opts in by providing gap_tolerance_ms, so no warning is issued
238232
reader_with_tolerance = BlackrockRawIO(filename=dirname, nsx_to_load=6, gap_tolerance_ms=10.0)
239233
reader_with_tolerance.parse_header()
240234
segments_with_tolerance = reader_with_tolerance.segment_count(0)
241235
self.assertEqual(1, segments_with_tolerance) # Gaps < 10ms are ignored
242236

243-
# Test 3: Very strict tolerance creates multiple segments
237+
# Test 3: Stricter tolerance creates 3 segments
244238
# With strict tolerance (0.5ms), gaps > 0.5ms will create new segments
245239
reader_strict = BlackrockRawIO(filename=dirname, nsx_to_load=6, gap_tolerance_ms=0.5)
246240
reader_strict.parse_header()
247241
segments_strict = reader_strict.segment_count(0)
248-
self.assertGreater(segments_strict, 1) # Should have multiple segments due to gaps
249-
250-
# Test 4: Different NSX files can have different gap patterns
251-
# Test ns4 file which has different gaps than ns6
252-
with self.assertRaises(ValueError) as context_ns4:
253-
reader_ns4 = BlackrockRawIO(filename=dirname, nsx_to_load=4)
254-
reader_ns4.parse_header()
255-
256-
error_msg_ns4 = str(context_ns4.exception)
257-
self.assertIn("ns4", error_msg_ns4)
258-
self.assertIn("gap", error_msg_ns4.lower())
259-
260-
# ns4 should also load with tolerance
261-
reader_ns4_with_tolerance = BlackrockRawIO(filename=dirname, nsx_to_load=4, gap_tolerance_ms=10.0)
262-
reader_ns4_with_tolerance.parse_header()
263-
self.assertEqual(1, reader_ns4_with_tolerance.segment_count(0))
242+
self.assertEqual(segments_strict, 3) #
264243

265244

266245
if __name__ == "__main__":

0 commit comments

Comments
 (0)