def test_prune_rule_2(self):
     df = pd.read_csv('tests/test_files/mushroom.csv',
                      encoding='utf-8',
                      delimiter=';')
     ds = BitmapDataset(0, df)
     l = Literal('a5', 'in', ['c', 'f', 'm', 'p', 's', 'y'])
     rule = Rule()
     rule.add_literal(l)
     rule = ds.unmake_rule(rule)
     rule = ds.prune_rule(rule)
     rule = ds.make_rule(rule)
     self.assertEqual("a5 in ['c', 'f', 'm', 'p', 's', 'y']",
                      rule.to_string())
 def test_prune_rule_1(self):
     df = pd.read_csv('tests/test_files/testfile_3.csv',
                      encoding='utf-8',
                      delimiter=';')
     l = Literal('Sex', 'in', 'Female')
     l2 = Literal('Sex', 'in', 'Male')
     rule = Rule()
     rule.add_literal(l)
     rule.add_literal(l2)
     ds = BitmapDataset(1, df)
     rule = ds.prune_rule(ds.unmake_rule(rule))
     rule = ds.make_rule(rule)
     self.assertEqual("", rule.to_string())