def test_event_times_are_correct(self): "Checks that events times are correct" eventtimes, eventlabels = ProcessEventList(eventlist=self.eventlist, tolerance=1, evtframe=self.df) equal = np.array_equal(np.array(eventtimes), np.arange(0, 100, 1) * pq.s) self.assertTrue(equal)
def test_event_labels_are_correct(self): "Checks that events labels are correct" eventtimes, eventlabels = ProcessEventList(eventlist=self.eventlist, tolerance=0.1, evtframe=self.df) test_array = np.arange(0, 100, 1) mask_array = np.arange(0, 100, 3) test_array = test_array.astype('S') test_array[mask_array] = 'stop' test_array[np.where(test_array != 'stop')[0]] = 'start' equal = np.array_equal(eventlabels, test_array) self.assertTrue(equal)
def test_event_labels_is_a_list(self): "Checks returned event_labels is a list" eventtimes, eventlabels = ProcessEventList(eventlist=self.eventlist, tolerance=1, evtframe=self.df) self.assertIsInstance(eventlabels, list)
def test_returns_two_variables(self): "Checks that two variables are returned" output = ProcessEventList(eventlist=self.eventlist, tolerance=1, evtframe=self.df) self.assertEqual(len(output), 2)