Revision 3f9db536
b/ci/pep8.sh | ||
---|---|---|
2 | 2 |
|
3 | 3 |
# Files to be excluded from pep8 tests |
4 | 4 |
EXCLUDE=migrations,build,setup,distribute_setup.py,\ |
5 |
setup.py,rapi.py,dictconfig.py,ordereddict.py |
|
5 |
setup.py,rapi.py,dictconfig.py,ordereddict.py,parsedate.py
|
|
6 | 6 |
|
7 | 7 |
# Keep only *.py files |
8 | 8 |
py_files=$(echo "$@" | awk '/.*\.py/' RS=" " ORS=" ") |
b/snf-django-lib/snf_django/utils/testing.py | ||
---|---|---|
130 | 130 |
with patch("snf_django.lib.api.get_token") as get_token: |
131 | 131 |
get_token.return_value = "DummyToken" |
132 | 132 |
with patch('astakosclient.AstakosClient.get_user_info') as m: |
133 |
m.return_value = {"uuid": user} |
|
134 |
yield |
|
135 |
|
|
136 |
serial = 0 |
|
133 |
m.return_value = {"uuid": uenc(user, 'utf8')} |
|
134 |
with patch('astakosclient.AstakosClient.get_quotas') as m2: |
|
135 |
m2.return_value = { |
|
136 |
"system": { |
|
137 |
"pithos.diskspace": { |
|
138 |
"usage": 0, |
|
139 |
"limit": 1073741824, # 1GB |
|
140 |
"pending": 0 |
|
141 |
} |
|
142 |
} |
|
143 |
} |
|
144 |
issue_fun = "astakosclient.AstakosClient.issue_one_commission" |
|
145 |
with patch(issue_fun) as m3: |
|
146 |
serials = [] |
|
147 |
append = serials.append |
|
148 |
|
|
149 |
def get_serial(*args, **kwargs): |
|
150 |
global serial |
|
151 |
serial += 1 |
|
152 |
append(serial) |
|
153 |
return serial |
|
154 |
|
|
155 |
m3.side_effect = get_serial |
|
156 |
resolv_fun = \ |
|
157 |
'astakosclient.AstakosClient.resolve_commissions' |
|
158 |
with patch(resolv_fun) as m4: |
|
159 |
m4.return_value = {'accepted': serials, |
|
160 |
'rejected': [], |
|
161 |
'failed': []} |
|
162 |
users_fun = 'astakosclient.AstakosClient.get_usernames' |
|
163 |
with patch(users_fun) as m5: |
|
164 |
|
|
165 |
def get_usernames(*args, **kwargs): |
|
166 |
uuids = args[-1] |
|
167 |
return dict((uuid, uuid) for uuid in uuids) |
|
168 |
|
|
169 |
m5.side_effect = get_usernames |
|
170 |
yield |
|
137 | 171 |
|
138 | 172 |
|
139 | 173 |
@contextmanager |
Also available in: Unified diff