From 97f3abe73eef60c67e97e02cf15834f79caf6926 Mon Sep 17 00:00:00 2001 From: Iustin Pop Date: Fri, 21 Apr 2023 01:54:44 +0200 Subject: [PATCH] Add a test for restoring state from invalid string This might be flaky, but I assume that the empty string will never be a valid ACL representation. If it changes, will have to fix the test. --- tests/test_acls.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/test_acls.py b/tests/test_acls.py index 2527dc3..d805b5c 100644 --- a/tests/test_acls.py +++ b/tests/test_acls.py @@ -523,6 +523,12 @@ class TestAclExtensions: assert a == b assert b != c + @require_copy_ext + def test_acl_copy_ext_failure(self): + a = posix1e.ACL() + with pytest.raises(IOError): + a.__setstate__(b'\0') + @require_copy_ext def test_acl_copy_ext_args(self): a = posix1e.ACL() -- 2.39.5