def test_delete_not_covered_1(self): df = pd.read_csv('tests/test_files/testfile_8.csv', encoding='utf-8', delimiter=';') rule = Rule() ds = DictDataset(1, df) len_before = ds.length() ds.delete_not_covered(rule) len_after = ds.length() self.assertEqual(0, len_after)
def test_delete_not_covered_3(self): df = pd.read_csv('tests/test_files/testfile_8.csv', encoding='utf-8', delimiter=';') l = Literal('ClassOfSeat', 'in', '1st') l2 = Literal('Age', '<', 20) rule = Rule() rule.add_literal(l) rule.add_literal(l2) ds = DictDataset(1, df) len_before = ds.length() ds.delete_not_covered(rule) len_after = ds.length() self.assertEqual(len_before - 30, len_after)
def test_length_dataset_4_all_n(self): df = pd.read_csv('tests/test_files/testfile_6_all_n.csv', encoding='utf-8', delimiter=';') ds = DictDataset(1, df) self.assertEqual(32, ds.length())
def test_length_dataset_2_no_rows(self): df = pd.read_csv('tests/test_files/testfile_11_no_rows.csv', encoding='utf-8', delimiter=';') ds = DictDataset(1, df) self.assertEqual(0, ds.length())