From 622dc12460c2628fc884c6309690ed56f461b855 Mon Sep 17 00:00:00 2001 From: Iustin Pop Date: Mon, 25 Nov 2019 05:12:45 +0100 Subject: [PATCH] Tests: remove_on_missing applies to symlinks as well --- test/test_xattr.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/test/test_xattr.py b/test/test_xattr.py index 088abf3..cf7c021 100644 --- a/test/test_xattr.py +++ b/test/test_xattr.py @@ -206,14 +206,15 @@ def test_create_on_existing(subject, use_ns): else: xattr.set(item, USER_ATTR, USER_VAL, flags=XATTR_CREATE) -def test_remove_on_missing(subject, use_ns): - item = subject[0] - lists_equal(xattr.list(item), []) +def test_remove_on_missing(any_subject, use_ns): + item, nofollow = any_subject + lists_equal(xattr.list(item, nofollow=nofollow), []) with pytest.raises(EnvironmentError): if use_ns: - xattr.remove(item, USER_NN, namespace=NAMESPACE) + xattr.remove(item, USER_NN, namespace=NAMESPACE, + nofollow=nofollow) else: - xattr.remove(item, USER_ATTR) + xattr.remove(item, USER_ATTR, nofollow=nofollow) def test_set_get_remove(subject, use_ns): item = subject[0] @@ -259,10 +260,10 @@ def test_create_on_existing_deprecated(subject): with pytest.raises(EnvironmentError): xattr.setxattr(item, USER_ATTR, USER_VAL, XATTR_CREATE) -def test_remove_on_missing_deprecated(subject): +def test_remove_on_missing_deprecated(any_subject): """check deprecated list, set, get operations against an item""" - item = subject[0] - lists_equal(xattr.listxattr(item), []) + item, nofollow = any_subject + lists_equal(xattr.listxattr(item, nofollow), []) with pytest.raises(EnvironmentError): xattr.removexattr(item, USER_ATTR) -- 2.39.2