def test_test_once_when_given_numpy_ndarray(self): data = np.array(self.data2) grubbs_test = grubbs.TwoSidedGrubbsTest(data) expected_index = 0 actual_index = grubbs_test._test_once(data, 0.05) self.assertEqual(actual_index, expected_index)
def test_delete_item_when_given_pandas_series(self): if pd is not None: data = pd.Series(self.data3) grubbs_test = grubbs.TwoSidedGrubbsTest(data) actual_data = grubbs_test._delete_item(data, 1) self.assertEqual(len(actual_data), 3)
def test_get_target_index_when_given_numpy_ndarray(self): data = np.array(self.data1) grubbs_test = grubbs.TwoSidedGrubbsTest(data) expected_index = 0 actual_index, _ = grubbs_test._target(data) self.assertEqual(actual_index, expected_index)
def test_check_type_when_given_pandas_series(self): if pd is not None: data = pd.Series(self.data1) grubbs_test = grubbs.TwoSidedGrubbsTest(data) copied_data = grubbs_test._copy_data() self.assertIsInstance(copied_data, pd.Series)
def test_test_once_when_given_pandas_series(self): if pd is not None: data = pd.Series(self.data2) grubbs_test = grubbs.TwoSidedGrubbsTest(data) expected_index = 0 actual_index = grubbs_test._test_once(data, 0.05) self.assertEqual(actual_index, expected_index)
def test_get_target_index_when_given_pandas_series(self): if pd is not None: data = pd.Series(self.data1) grubbs_test = grubbs.TwoSidedGrubbsTest(data) expected_index = 0 actual_index, _ = grubbs_test._target(data) self.assertEqual(actual_index, expected_index)
def test_delete_item_when_given_numpy_ndarray(self): data = np.array(self.data3) grubbs_test = grubbs.TwoSidedGrubbsTest(data) actual_data = grubbs_test._delete_item(data, 1) self.assertEqual(len(actual_data), 3)
def test_check_type_when_given_list(self): grubbs_test = grubbs.TwoSidedGrubbsTest(self.data1) copied_data = grubbs_test._copy_data() self.assertIsInstance(copied_data, np.ndarray)