##// END OF EJS Templates
tests: get rid of yield-based tests...
Thomas De Schampheleire -
r6109:07844f0b default
parent child Browse files
Show More
@@ -71,13 +71,13 b' def test_user_permissions_on_group_witho'
71 expected = 0
71 expected = 0
72 assert len(items) == expected, ' %s != %s' % (len(items), expected)
72 assert len(items) == expected, ' %s != %s' % (len(items), expected)
73 for name, perm in items:
73 for name, perm in items:
74 yield check_tree_perms, name, perm, group, 'repository.read'
74 check_tree_perms(name, perm, group, 'repository.read')
75
75
76 items = [x for x in _get_group_perms(group, recursive)]
76 items = [x for x in _get_group_perms(group, recursive)]
77 expected = 1
77 expected = 1
78 assert len(items) == expected, ' %s != %s' % (len(items), expected)
78 assert len(items) == expected, ' %s != %s' % (len(items), expected)
79 for name, perm in items:
79 for name, perm in items:
80 yield check_tree_perms, name, perm, group, 'group.write'
80 check_tree_perms(name, perm, group, 'group.write')
81
81
82
82
83 def test_user_permissions_on_group_without_recursive_mode_subgroup():
83 def test_user_permissions_on_group_without_recursive_mode_subgroup():
@@ -90,13 +90,13 b' def test_user_permissions_on_group_witho'
90 expected = 0
90 expected = 0
91 assert len(items) == expected, ' %s != %s' % (len(items), expected)
91 assert len(items) == expected, ' %s != %s' % (len(items), expected)
92 for name, perm in items:
92 for name, perm in items:
93 yield check_tree_perms, name, perm, group, 'repository.read'
93 check_tree_perms(name, perm, group, 'repository.read')
94
94
95 items = [x for x in _get_group_perms(group, recursive)]
95 items = [x for x in _get_group_perms(group, recursive)]
96 expected = 1
96 expected = 1
97 assert len(items) == expected, ' %s != %s' % (len(items), expected)
97 assert len(items) == expected, ' %s != %s' % (len(items), expected)
98 for name, perm in items:
98 for name, perm in items:
99 yield check_tree_perms, name, perm, group, 'group.write'
99 check_tree_perms(name, perm, group, 'group.write')
100
100
101
101
102 def test_user_permissions_on_group_with_recursive_mode():
102 def test_user_permissions_on_group_with_recursive_mode():
@@ -112,10 +112,10 b' def test_user_permissions_on_group_with_'
112 _check_expected_count(items, repo_items, expected_count(group, True))
112 _check_expected_count(items, repo_items, expected_count(group, True))
113
113
114 for name, perm in repo_items:
114 for name, perm in repo_items:
115 yield check_tree_perms, name, perm, group, 'repository.write'
115 check_tree_perms(name, perm, group, 'repository.write')
116
116
117 for name, perm in items:
117 for name, perm in items:
118 yield check_tree_perms, name, perm, group, 'group.write'
118 check_tree_perms(name, perm, group, 'group.write')
119
119
120
120
121 def test_user_permissions_on_group_with_recursive_mode_inner_group():
121 def test_user_permissions_on_group_with_recursive_mode_inner_group():
@@ -129,10 +129,10 b' def test_user_permissions_on_group_with_'
129 _check_expected_count(items, repo_items, expected_count(group, True))
129 _check_expected_count(items, repo_items, expected_count(group, True))
130
130
131 for name, perm in repo_items:
131 for name, perm in repo_items:
132 yield check_tree_perms, name, perm, group, 'repository.none'
132 check_tree_perms(name, perm, group, 'repository.none')
133
133
134 for name, perm in items:
134 for name, perm in items:
135 yield check_tree_perms, name, perm, group, 'group.none'
135 check_tree_perms(name, perm, group, 'group.none')
136
136
137
137
138 def test_user_permissions_on_group_with_recursive_mode_deepest():
138 def test_user_permissions_on_group_with_recursive_mode_deepest():
@@ -146,10 +146,10 b' def test_user_permissions_on_group_with_'
146 _check_expected_count(items, repo_items, expected_count(group, True))
146 _check_expected_count(items, repo_items, expected_count(group, True))
147
147
148 for name, perm in repo_items:
148 for name, perm in repo_items:
149 yield check_tree_perms, name, perm, group, 'repository.write'
149 check_tree_perms(name, perm, group, 'repository.write')
150
150
151 for name, perm in items:
151 for name, perm in items:
152 yield check_tree_perms, name, perm, group, 'group.write'
152 check_tree_perms(name, perm, group, 'group.write')
153
153
154
154
155 def test_user_permissions_on_group_with_recursive_mode_only_with_repos():
155 def test_user_permissions_on_group_with_recursive_mode_only_with_repos():
@@ -163,10 +163,10 b' def test_user_permissions_on_group_with_'
163 _check_expected_count(items, repo_items, expected_count(group, True))
163 _check_expected_count(items, repo_items, expected_count(group, True))
164
164
165 for name, perm in repo_items:
165 for name, perm in repo_items:
166 yield check_tree_perms, name, perm, group, 'repository.admin'
166 check_tree_perms(name, perm, group, 'repository.admin')
167
167
168 for name, perm in items:
168 for name, perm in items:
169 yield check_tree_perms, name, perm, group, 'group.admin'
169 check_tree_perms(name, perm, group, 'group.admin')
170
170
171
171
172 def test_user_permissions_on_group_with_recursive_mode_on_repos():
172 def test_user_permissions_on_group_with_recursive_mode_on_repos():
@@ -181,7 +181,7 b' def test_user_permissions_on_group_with_'
181 _check_expected_count(items, repo_items, expected_count(group, True))
181 _check_expected_count(items, repo_items, expected_count(group, True))
182
182
183 for name, perm in repo_items:
183 for name, perm in repo_items:
184 yield check_tree_perms, name, perm, group, 'repository.write'
184 check_tree_perms(name, perm, group, 'repository.write')
185
185
186 for name, perm in items:
186 for name, perm in items:
187 # permission is set with repos only mode, but we also change the permission
187 # permission is set with repos only mode, but we also change the permission
@@ -190,7 +190,7 b' def test_user_permissions_on_group_with_'
190 old_perm = 'group.read'
190 old_perm = 'group.read'
191 if name == group:
191 if name == group:
192 old_perm = perm
192 old_perm = perm
193 yield check_tree_perms, name, perm, group, old_perm
193 check_tree_perms(name, perm, group, old_perm)
194
194
195
195
196 def test_user_permissions_on_group_with_recursive_mode_on_repo_groups():
196 def test_user_permissions_on_group_with_recursive_mode_on_repo_groups():
@@ -205,7 +205,7 b' def test_user_permissions_on_group_with_'
205 _check_expected_count(items, repo_items, expected_count(group, True))
205 _check_expected_count(items, repo_items, expected_count(group, True))
206
206
207 for name, perm in repo_items:
207 for name, perm in repo_items:
208 yield check_tree_perms, name, perm, group, 'repository.read'
208 check_tree_perms(name, perm, group, 'repository.read')
209
209
210 for name, perm in items:
210 for name, perm in items:
211 yield check_tree_perms, name, perm, group, 'group.none'
211 check_tree_perms(name, perm, group, 'group.none')
@@ -65,13 +65,13 b' def test_user_permissions_on_group_witho'
65 expected = 0
65 expected = 0
66 assert len(items) == expected, ' %s != %s' % (len(items), expected)
66 assert len(items) == expected, ' %s != %s' % (len(items), expected)
67 for name, perm in items:
67 for name, perm in items:
68 yield check_tree_perms, name, perm, group, 'repository.read'
68 check_tree_perms(name, perm, group, 'repository.read')
69
69
70 items = [x for x in _get_group_perms(group, recursive)]
70 items = [x for x in _get_group_perms(group, recursive)]
71 expected = 1
71 expected = 1
72 assert len(items) == expected, ' %s != %s' % (len(items), expected)
72 assert len(items) == expected, ' %s != %s' % (len(items), expected)
73 for name, perm in items:
73 for name, perm in items:
74 yield check_tree_perms, name, perm, group, 'group.write'
74 check_tree_perms(name, perm, group, 'group.write')
75
75
76
76
77 def test_user_permissions_on_group_without_recursive_mode_subgroup():
77 def test_user_permissions_on_group_without_recursive_mode_subgroup():
@@ -84,13 +84,13 b' def test_user_permissions_on_group_witho'
84 expected = 0
84 expected = 0
85 assert len(items) == expected, ' %s != %s' % (len(items), expected)
85 assert len(items) == expected, ' %s != %s' % (len(items), expected)
86 for name, perm in items:
86 for name, perm in items:
87 yield check_tree_perms, name, perm, group, 'repository.read'
87 check_tree_perms(name, perm, group, 'repository.read')
88
88
89 items = [x for x in _get_group_perms(group, recursive)]
89 items = [x for x in _get_group_perms(group, recursive)]
90 expected = 1
90 expected = 1
91 assert len(items) == expected, ' %s != %s' % (len(items), expected)
91 assert len(items) == expected, ' %s != %s' % (len(items), expected)
92 for name, perm in items:
92 for name, perm in items:
93 yield check_tree_perms, name, perm, group, 'group.write'
93 check_tree_perms(name, perm, group, 'group.write')
94
94
95
95
96 def test_user_permissions_on_group_with_recursive_mode():
96 def test_user_permissions_on_group_with_recursive_mode():
@@ -106,10 +106,10 b' def test_user_permissions_on_group_with_'
106 _check_expected_count(items, repo_items, expected_count(group, True))
106 _check_expected_count(items, repo_items, expected_count(group, True))
107
107
108 for name, perm in repo_items:
108 for name, perm in repo_items:
109 yield check_tree_perms, name, perm, group, 'repository.write'
109 check_tree_perms(name, perm, group, 'repository.write')
110
110
111 for name, perm in items:
111 for name, perm in items:
112 yield check_tree_perms, name, perm, group, 'group.write'
112 check_tree_perms(name, perm, group, 'group.write')
113
113
114
114
115 def test_user_permissions_on_group_with_recursive_mode_for_default_user():
115 def test_user_permissions_on_group_with_recursive_mode_for_default_user():
@@ -133,10 +133,10 b' def test_user_permissions_on_group_with_'
133 _check_expected_count(items, repo_items, expected_count(group, True))
133 _check_expected_count(items, repo_items, expected_count(group, True))
134
134
135 for name, perm in repo_items:
135 for name, perm in repo_items:
136 yield check_tree_perms, name, perm, group, 'repository.write'
136 check_tree_perms(name, perm, group, 'repository.write')
137
137
138 for name, perm in items:
138 for name, perm in items:
139 yield check_tree_perms, name, perm, group, 'group.write'
139 check_tree_perms(name, perm, group, 'group.write')
140
140
141
141
142 def test_user_permissions_on_group_with_recursive_mode_inner_group():
142 def test_user_permissions_on_group_with_recursive_mode_inner_group():
@@ -150,10 +150,10 b' def test_user_permissions_on_group_with_'
150 _check_expected_count(items, repo_items, expected_count(group, True))
150 _check_expected_count(items, repo_items, expected_count(group, True))
151
151
152 for name, perm in repo_items:
152 for name, perm in repo_items:
153 yield check_tree_perms, name, perm, group, 'repository.none'
153 check_tree_perms(name, perm, group, 'repository.none')
154
154
155 for name, perm in items:
155 for name, perm in items:
156 yield check_tree_perms, name, perm, group, 'group.none'
156 check_tree_perms(name, perm, group, 'group.none')
157
157
158
158
159 def test_user_permissions_on_group_with_recursive_mode_deepest():
159 def test_user_permissions_on_group_with_recursive_mode_deepest():
@@ -167,10 +167,10 b' def test_user_permissions_on_group_with_'
167 _check_expected_count(items, repo_items, expected_count(group, True))
167 _check_expected_count(items, repo_items, expected_count(group, True))
168
168
169 for name, perm in repo_items:
169 for name, perm in repo_items:
170 yield check_tree_perms, name, perm, group, 'repository.write'
170 check_tree_perms(name, perm, group, 'repository.write')
171
171
172 for name, perm in items:
172 for name, perm in items:
173 yield check_tree_perms, name, perm, group, 'group.write'
173 check_tree_perms(name, perm, group, 'group.write')
174
174
175
175
176 def test_user_permissions_on_group_with_recursive_mode_only_with_repos():
176 def test_user_permissions_on_group_with_recursive_mode_only_with_repos():
@@ -184,10 +184,10 b' def test_user_permissions_on_group_with_'
184 _check_expected_count(items, repo_items, expected_count(group, True))
184 _check_expected_count(items, repo_items, expected_count(group, True))
185
185
186 for name, perm in repo_items:
186 for name, perm in repo_items:
187 yield check_tree_perms, name, perm, group, 'repository.admin'
187 check_tree_perms(name, perm, group, 'repository.admin')
188
188
189 for name, perm in items:
189 for name, perm in items:
190 yield check_tree_perms, name, perm, group, 'group.admin'
190 check_tree_perms(name, perm, group, 'group.admin')
191
191
192
192
193 def test_user_permissions_on_group_with_recursive_repo_mode_for_default_user():
193 def test_user_permissions_on_group_with_recursive_repo_mode_for_default_user():
@@ -212,7 +212,7 b' def test_user_permissions_on_group_with_'
212 _check_expected_count(items, repo_items, expected_count(group, True))
212 _check_expected_count(items, repo_items, expected_count(group, True))
213
213
214 for name, perm in repo_items:
214 for name, perm in repo_items:
215 yield check_tree_perms, name, perm, group, 'repository.none'
215 check_tree_perms(name, perm, group, 'repository.none')
216
216
217 for name, perm in items:
217 for name, perm in items:
218 # permission is set with repos only mode, but we also change the permission
218 # permission is set with repos only mode, but we also change the permission
@@ -221,7 +221,7 b' def test_user_permissions_on_group_with_'
221 old_perm = 'group.read'
221 old_perm = 'group.read'
222 if name == group:
222 if name == group:
223 old_perm = perm
223 old_perm = perm
224 yield check_tree_perms, name, perm, group, old_perm
224 check_tree_perms(name, perm, group, old_perm)
225
225
226
226
227 def test_user_permissions_on_group_with_recursive_repo_mode_inner_group():
227 def test_user_permissions_on_group_with_recursive_repo_mode_inner_group():
@@ -236,7 +236,7 b' def test_user_permissions_on_group_with_'
236 _check_expected_count(items, repo_items, expected_count(group, True))
236 _check_expected_count(items, repo_items, expected_count(group, True))
237
237
238 for name, perm in repo_items:
238 for name, perm in repo_items:
239 yield check_tree_perms, name, perm, group, 'repository.none'
239 check_tree_perms(name, perm, group, 'repository.none')
240
240
241 for name, perm in items:
241 for name, perm in items:
242 # permission is set with repos only mode, but we also change the permission
242 # permission is set with repos only mode, but we also change the permission
@@ -245,7 +245,7 b' def test_user_permissions_on_group_with_'
245 old_perm = 'group.read'
245 old_perm = 'group.read'
246 if name == group:
246 if name == group:
247 old_perm = perm
247 old_perm = perm
248 yield check_tree_perms, name, perm, group, old_perm
248 check_tree_perms(name, perm, group, old_perm)
249
249
250
250
251 def test_user_permissions_on_group_with_recursive_group_mode_for_default_user():
251 def test_user_permissions_on_group_with_recursive_group_mode_for_default_user():
@@ -269,10 +269,10 b' def test_user_permissions_on_group_with_'
269 _check_expected_count(items, repo_items, expected_count(group, True))
269 _check_expected_count(items, repo_items, expected_count(group, True))
270
270
271 for name, perm in repo_items:
271 for name, perm in repo_items:
272 yield check_tree_perms, name, perm, group, 'repository.read'
272 check_tree_perms(name, perm, group, 'repository.read')
273
273
274 for name, perm in items:
274 for name, perm in items:
275 yield check_tree_perms, name, perm, group, 'group.write'
275 check_tree_perms(name, perm, group, 'group.write')
276
276
277
277
278 def test_user_permissions_on_group_with_recursive_group_mode_inner_group():
278 def test_user_permissions_on_group_with_recursive_group_mode_inner_group():
@@ -286,7 +286,7 b' def test_user_permissions_on_group_with_'
286 _check_expected_count(items, repo_items, expected_count(group, True))
286 _check_expected_count(items, repo_items, expected_count(group, True))
287
287
288 for name, perm in repo_items:
288 for name, perm in repo_items:
289 yield check_tree_perms, name, perm, group, 'repository.read'
289 check_tree_perms(name, perm, group, 'repository.read')
290
290
291 for name, perm in items:
291 for name, perm in items:
292 yield check_tree_perms, name, perm, group, 'group.none'
292 check_tree_perms(name, perm, group, 'group.none')
General Comments 0
You need to be logged in to leave comments. Login now