diff options
Diffstat (limited to 'dev-python/redis-py/files/redis-py-3.5.3-fix-user-tests.patch')
-rw-r--r-- | dev-python/redis-py/files/redis-py-3.5.3-fix-user-tests.patch | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/dev-python/redis-py/files/redis-py-3.5.3-fix-user-tests.patch b/dev-python/redis-py/files/redis-py-3.5.3-fix-user-tests.patch new file mode 100644 index 000000000000..36ff4b0bf60a --- /dev/null +++ b/dev-python/redis-py/files/redis-py-3.5.3-fix-user-tests.patch @@ -0,0 +1,72 @@ +diff --git a/tests/test_commands.py b/tests/test_commands.py +index 65e877c..448d30c 100644 +--- a/tests/test_commands.py ++++ b/tests/test_commands.py +@@ -105,25 +105,24 @@ class TestRedisCommands(object): + + # test enabled=False + assert r.acl_setuser(username, enabled=False, reset=True) +- assert r.acl_getuser(username) == { +- 'categories': ['-@all'], +- 'commands': [], +- 'enabled': False, +- 'flags': ['off'], +- 'keys': [], +- 'passwords': [], +- } ++ acl = r.acl_getuser(username) ++ assert acl['categories'] == ['-@all'] ++ assert acl['commands'] == [] ++ assert acl['keys'] == [] ++ assert acl['passwords'] == [] ++ assert 'off' in acl['flags'] ++ assert acl['enabled'] is False + + # test nopass=True + assert r.acl_setuser(username, enabled=True, reset=True, nopass=True) +- assert r.acl_getuser(username) == { +- 'categories': ['-@all'], +- 'commands': [], +- 'enabled': True, +- 'flags': ['on', 'nopass'], +- 'keys': [], +- 'passwords': [], +- } ++ acl = r.acl_getuser(username) ++ assert acl['categories'] == ['-@all'] ++ assert acl['commands'] == [] ++ assert acl['keys'] == [] ++ assert acl['passwords'] == [] ++ assert 'on' in acl['flags'] ++ assert 'nopass' in acl['flags'] ++ assert acl['enabled'] is True + + # test all args + assert r.acl_setuser(username, enabled=True, reset=True, +@@ -135,7 +134,7 @@ class TestRedisCommands(object): + assert set(acl['categories']) == set(['-@all', '+@set', '+@hash']) + assert set(acl['commands']) == set(['+get', '+mget', '-hset']) + assert acl['enabled'] is True +- assert acl['flags'] == ['on'] ++ assert 'on' in acl['flags'] + assert set(acl['keys']) == set([b'cache:*', b'objects:*']) + assert len(acl['passwords']) == 2 + +@@ -154,7 +153,7 @@ class TestRedisCommands(object): + assert set(acl['categories']) == set(['-@all', '+@set', '+@hash']) + assert set(acl['commands']) == set(['+get', '+mget']) + assert acl['enabled'] is True +- assert acl['flags'] == ['on'] ++ assert 'on' in acl['flags'] + assert set(acl['keys']) == set([b'cache:*', b'objects:*']) + assert len(acl['passwords']) == 2 + +@@ -193,7 +192,7 @@ class TestRedisCommands(object): + + assert r.acl_setuser(username, enabled=False, reset=True) + users = r.acl_list() +- assert 'user %s off -@all' % username in users ++ assert len(users) == 2 + + @skip_if_server_version_lt(REDIS_6_VERSION) + def test_acl_setuser_categories_without_prefix_fails(self, r, request): |