LEFT | RIGHT |
(no file at all) | |
1 # Copyright: 2003-2004 by Juergen Hermann <jh@web.de> | 1 # Copyright: 2003-2004 by Juergen Hermann <jh@web.de> |
2 # Copyright: 2007 by MoinMoin:ThomasWaldmann | 2 # Copyright: 2007 by MoinMoin:ThomasWaldmann |
3 # Copyright: 2008 by MoinMoin:MelitaMihaljevic | 3 # Copyright: 2008 by MoinMoin:MelitaMihaljevic |
4 # Copyright: 2009 by MoinMoin:DmitrijsMilajevs | 4 # Copyright: 2009 by MoinMoin:DmitrijsMilajevs |
5 # License: GNU GPL v2 (or any later version), see LICENSE.txt for details. | 5 # License: GNU GPL v2 (or any later version), see LICENSE.txt for details. |
6 | 6 |
7 """ | 7 """ |
8 MoinMoin - MoinMoin.datastruct.backends base test classes. | 8 MoinMoin - MoinMoin.datastruct.backends base test classes. |
9 """ | 9 """ |
10 | 10 |
11 | 11 |
12 from pytest import raises | 12 from pytest import raises, skip |
13 | 13 |
14 from flask import current_app as app | 14 from flask import current_app as app |
15 from flask import g as flaskg | 15 from flask import g as flaskg |
16 | 16 |
17 from MoinMoin.security import AccessControlList | 17 from MoinMoin.security import AccessControlList |
18 from MoinMoin.datastruct import GroupDoesNotExistError | 18 from MoinMoin.datastruct import GroupDoesNotExistError |
19 | 19 |
20 | 20 |
21 class GroupsBackendTest(object): | 21 class GroupsBackendTest(object): |
22 | 22 |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 | 70 |
71 def test_get(self): | 71 def test_get(self): |
72 groups = flaskg.groups | 72 groups = flaskg.groups |
73 | 73 |
74 assert groups.get(u'AdminGroup') | 74 assert groups.get(u'AdminGroup') |
75 assert u'NotExistingGroup' not in groups | 75 assert u'NotExistingGroup' not in groups |
76 assert groups.get(u'NotExistingGroup') is None | 76 assert groups.get(u'NotExistingGroup') is None |
77 assert groups.get(u'NotExistingGroup', []) == [] | 77 assert groups.get(u'NotExistingGroup', []) == [] |
78 | 78 |
79 def test_groups_with_member(self): | 79 def test_groups_with_member(self): |
| 80 # FIXME: because of something, index already has some groups |
| 81 #skip('FIXME') |
80 groups = flaskg.groups | 82 groups = flaskg.groups |
81 | 83 |
82 john_groups = list(groups.groups_with_member(u'John')) | 84 john_groups = list(groups.groups_with_member(u'John')) |
83 assert 2 == len(john_groups) | 85 assert 2 == len(john_groups) |
84 assert u'EditorGroup' in john_groups | 86 assert u'EditorGroup' in john_groups |
85 assert u'AdminGroup' in john_groups | 87 assert u'AdminGroup' in john_groups |
86 assert u'ThirdGroup' not in john_groups | 88 assert u'ThirdGroup' not in john_groups |
87 | 89 |
88 def test_backend_acl_allow(self): | 90 def test_backend_acl_allow(self): |
89 """ | 91 """ |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 assert dicts.get(u'SomeNotExistingDict', {}) == {} | 181 assert dicts.get(u'SomeNotExistingDict', {}) == {} |
180 | 182 |
181 | 183 |
182 for dict_name, expected_dict in self.dicts.items(): | 184 for dict_name, expected_dict in self.dicts.items(): |
183 test_dict = dicts[dict_name] | 185 test_dict = dicts[dict_name] |
184 for key, value in expected_dict.items(): | 186 for key, value in expected_dict.items(): |
185 assert u'SomeNotExistingKey' not in test_dict | 187 assert u'SomeNotExistingKey' not in test_dict |
186 assert test_dict.get(u'SomeNotExistingKey') is None | 188 assert test_dict.get(u'SomeNotExistingKey') is None |
187 assert test_dict.get(u'SomeNotExistingKey', {}) == {} | 189 assert test_dict.get(u'SomeNotExistingKey', {}) == {} |
188 | 190 |
LEFT | RIGHT |