Changeset View
Changeset View
Standalone View
Standalone View
security/py-pylibacl/files/patch-test-test_acls.py
- This file was added.
Property | Old Value | New Value |
---|---|---|
fbsd:nokeywords | null | yes \ No newline at end of property |
svn:eol-style | null | native \ No newline at end of property |
svn:mime-type | null | text/plain \ No newline at end of property |
--- test/test_acls.py.orig 2019-03-03 11:47:04 UTC | |||||
+++ test/test_acls.py | |||||
@@ -177,13 +177,16 @@ class LoadTests(aclTest, unittest.TestCase): | |||||
class AclExtensions(aclTest, unittest.TestCase): | |||||
"""ACL extensions checks""" | |||||
+ # Linux-specific tests that cause NameErrors when the flag | |||||
+ # functionality is tested. | |||||
+ ''' | |||||
@unittest.skipUnless(HAS_ACL_FROM_MODE, "Missing HAS_ACL_FROM_MODE") | |||||
def testFromMode(self): | |||||
"""Test loading ACLs from an octal mode""" | |||||
acl1 = posix1e.ACL(mode=M0644) | |||||
self.assertTrue(acl1.valid(), | |||||
"ACL created via octal mode shoule be valid") | |||||
- | |||||
+ | |||||
@unittest.skipUnless(HAS_ACL_CHECK, "ACL check not supported") | |||||
def testAclCheck(self): | |||||
"""Test the acl_check method""" | |||||
@@ -191,7 +194,7 @@ class AclExtensions(aclTest, unittest.TestCase): | |||||
self.assertFalse(acl1.check(), "ACL is not valid") | |||||
acl2 = posix1e.ACL() | |||||
self.assertTrue(acl2.check(), "Empty ACL should not be valid") | |||||
- | |||||
+ | |||||
@unittest.skipUnless(HAS_EXTENDED_CHECK, "Extended ACL check not supported") | |||||
def testExtended(self): | |||||
"""Test the acl_extended function""" | |||||
@@ -208,7 +211,7 @@ class AclExtensions(aclTest, unittest.TestCase): | |||||
for item in fd, fname: | |||||
self.assertTrue(has_extended(item), | |||||
"An extended ACL should be reported as such") | |||||
- | |||||
+ | |||||
@unittest.skipUnless(HAS_EXTENDED_CHECK, "Extended ACL check not supported") | |||||
def testExtendedArgHandling(self): | |||||
self.assertRaises(TypeError, has_extended) | |||||
@@ -251,6 +254,8 @@ class AclExtensions(aclTest, unittest.TestCase): | |||||
self.assertTrue(acl1 != True) | |||||
self.assertFalse(acl1 == 1) | |||||
self.assertRaises(TypeError, operator.gt, acl1, True) | |||||
+ ''' | |||||
+ # End | |||||
@unittest.skipUnless(hasattr(posix1e.ACL, "__cmp__"), "__cmp__ is missing") | |||||
@unittest.skipUnless(__pypy__ is None, "Disabled under pypy") | |||||
@@ -264,12 +269,17 @@ class AclExtensions(aclTest, unittest.TestCase): | |||||
self.assertRaises(TypeError, acl1.applyto, object()) | |||||
self.assertRaises(TypeError, acl1.applyto, object(), object()) | |||||
+ # Linux-specific tests that cause NameErrors when the flag | |||||
+ # functionality is tested. | |||||
+ ''' | |||||
@unittest.skipUnless(HAS_ACL_ENTRY, "ACL entries not supported") | |||||
def testAclIterator(self): | |||||
acl = posix1e.ACL(text=BASIC_ACL_TEXT) | |||||
#self.assertEqual(len(acl), 3) | |||||
for entry in acl: | |||||
self.assertIs(entry.parent, acl) | |||||
+ ''' | |||||
+ # End | |||||
class WriteTests(aclTest, unittest.TestCase): | |||||
@@ -295,6 +305,9 @@ class WriteTests(aclTest, unittest.TestCase): | |||||
acl2.applyto(dname) | |||||
+# Linux-specific tests that cause NameErrors when the flag | |||||
+# functionality is tested. | |||||
+''' | |||||
@unittest.skipUnless(HAS_ACL_ENTRY, "ACL entries not supported") | |||||
class ModificationTests(aclTest, unittest.TestCase): | |||||
"""ACL modification tests""" | |||||
@@ -670,6 +683,7 @@ class ModificationTests(aclTest, unittest.TestCase): | |||||
self.assertRaises(EnvironmentError, set_tag, tag) | |||||
# Check tag is still valid. | |||||
self.assertEqual(e.tag_type, posix1e.ACL_USER_OBJ) | |||||
+''' | |||||
if __name__ == "__main__": | |||||
unittest.main() |