Gitlab Community Edition Instance

Commit 3a685b45 authored by mhellka's avatar mhellka
Browse files

Fixed mocked tests for keepalive().

As a side note, I do not think that mocking CDSTAR on REST level
is reasonable. The CDStar class should be tested against the real thing
(integration tests) and all other classes should be tested against a
mocked CDStar instance. Or, switch to a proper urllib mocking framework.
The current tests are very error prone and do not actually verify the
correctness of the client library.
parent e2d63b74
...@@ -40,6 +40,14 @@ def mockserver(mocker): ...@@ -40,6 +40,14 @@ def mockserver(mocker):
elif method == 'GET' and path == '/x': elif method == 'GET' and path == '/x':
payload = {'public': True} payload = {'public': True}
elif method == 'GET' and path == '/_tx/tx': elif method == 'GET' and path == '/_tx/tx':
payload = {
'isolation': 'snapshot',
'timeout': 60,
'ttl': 60,
'readonly': False,
'id': 'tx'
elif method == 'POST' and path == '/_tx/tx' and kw.get("params", None) == {"renew": True}:
payload = { payload = {
'isolation': 'snapshot', 'isolation': 'snapshot',
'timeout': 60, 'timeout': 60,
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment