summaryrefslogtreecommitdiff
path: root/dev-python/redis-py/files/redis-py-3.5.3-fix-user-tests.patch
blob: 36ff4b0bf60a6f47af2b2c756a4e6de5322c442b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
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):