def _run_test(self, params, expected): regex, is_path, check_for = params aare_obj_1 = AARE(regex, is_path) aare_obj_2 = AARE(check_for, is_path) self.assertEqual(expected, aare_obj_1.is_equal(check_for)) self.assertEqual(expected, aare_obj_1.is_equal(aare_obj_2))
def test_is_equal_invalid_1(self): aare_obj = AARE('/foo/**', True) with self.assertRaises(AppArmorBug): aare_obj.is_equal(42)
def test_match_against_AARE_2(self): aare_obj_1 = AARE('@{foo}/[a-d]**', True) aare_obj_2 = AARE('@{foo}/*[a-d]*', True) self.assertFalse(aare_obj_1.match(aare_obj_2)) self.assertFalse(aare_obj_1.is_equal(aare_obj_2))