Skip to content

Commit

Permalink
Fix unit test for arm
Browse files Browse the repository at this point in the history
  • Loading branch information
holgern committed Apr 16, 2021
1 parent 0af374c commit a189d45
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions pyedflib/tests/test_edfwriter.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,16 +148,16 @@ def test_subsecond_annotation(self):
del f
np.testing.assert_almost_equal(ann_time[0], 1.2345, decimal=4)
np.testing.assert_almost_equal(ann_duration[0], 0.2222, decimal=4)
np.testing.assert_equal(ann_text[0] in ["annotation1_..", "annotation1_ä"], True)
np.testing.assert_equal(ann_text[0][0:12], "annotation1_")
np.testing.assert_almost_equal(ann_time[1], 0.2567, decimal=4)
np.testing.assert_almost_equal(ann_duration[1], -1)
np.testing.assert_equal(ann_text[1] in ["annotation2_..", "annotation2_ä"], True)
np.testing.assert_equal(ann_text[1][0:12], "annotation2_")
np.testing.assert_almost_equal(ann_time[2], 1.2567, decimal=4)
np.testing.assert_almost_equal(ann_duration[2], 0)
np.testing.assert_equal(ann_text[2] in ["annotation3_..", "annotation3_ä"], True)
np.testing.assert_equal(ann_text[2][0:12], "annotation3_")
np.testing.assert_almost_equal(ann_time[3], 1.3067, decimal=4)
np.testing.assert_almost_equal(ann_duration[3], -1)
np.testing.assert_equal(ann_text[3] in ["annotation4_..", "annotation4_ä"], True)
np.testing.assert_equal(ann_text[3][0:12], "annotation4_")

def test_EdfWriter_BDFplus(self):
channel_info1 = {'label': 'test_label', 'dimension': 'mV', 'sample_rate': 100,
Expand Down Expand Up @@ -632,16 +632,16 @@ def test_AnnotationWriting(self):
del f
np.testing.assert_almost_equal(ann_time[0], 1.23)
np.testing.assert_almost_equal(ann_duration[0], 0.2)
np.testing.assert_equal(ann_text[0] in ["annotation1_..", "annotation1_ä"], True)
np.testing.assert_equal(ann_text[0][0:12], "annotation1_")
np.testing.assert_almost_equal(ann_time[1], 0.25)
np.testing.assert_almost_equal(ann_duration[1], -1)
np.testing.assert_equal(ann_text[1] in ["annotation2_..", "annotation2_ä"], True)
np.testing.assert_equal(ann_text[1][0:12], "annotation2_")
np.testing.assert_almost_equal(ann_time[2], 1.25)
np.testing.assert_almost_equal(ann_duration[2], 0)
np.testing.assert_equal(ann_text[2] in ["annotation3_..", "annotation3_ä"], True)
np.testing.assert_equal(ann_text[2][0:12], "annotation3_")
np.testing.assert_almost_equal(ann_time[3], 1.30)
np.testing.assert_almost_equal(ann_duration[3], -1)
np.testing.assert_equal(ann_text[3] in ["annotation4_..", "annotation4_ä"], True)
np.testing.assert_equal(ann_text[3][0:12], "annotation4_")

def test_AnnotationWritingUTF8(self):
channel_info = {'label': 'test_label', 'dimension': 'mV', 'sample_rate': 100,
Expand All @@ -668,10 +668,11 @@ def test_AnnotationWritingUTF8(self):
del f
np.testing.assert_almost_equal(ann_time[0], 1.23)
np.testing.assert_almost_equal(ann_duration[0], 0.2)
np.testing.assert_equal(ann_text[0] in ["Z..hne", "Zähne"], True)
np.testing.assert_equal(ann_text[0][:1], "Z")
np.testing.assert_equal(ann_text[0][3:], "hne")
np.testing.assert_almost_equal(ann_time[1], 0.25)
np.testing.assert_almost_equal(ann_duration[1], -1)
np.testing.assert_equal(ann_text[1] in ["Fu..", "Fuä"], True)
np.testing.assert_equal(ann_text[1][:2], "Fu")
np.testing.assert_almost_equal(ann_time[2], 1.25)
np.testing.assert_almost_equal(ann_duration[2], 0)
np.testing.assert_equal(ann_text[2], "abc")
Expand Down

0 comments on commit a189d45

Please sign in to comment.