diff options
author | Lars Wirzenius <liw@liw.fi> | 2019-03-09 10:13:48 +0200 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2019-03-09 10:13:48 +0200 |
commit | eeff0a63cfb8f72a8479371366aca4c71a483509 (patch) | |
tree | efa5a994424ed5b007df92407f9c867a0a39968e /effiapi | |
parent | e6b021da4c7f58943c9bc5d5d4905ab655128973 (diff) | |
download | effi-reg-eeff0a63cfb8f72a8479371366aca4c71a483509.tar.gz |
Add: check that creating resource increments /status count
Diffstat (limited to 'effiapi')
-rwxr-xr-x | effiapi | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -99,6 +99,22 @@ class FakeHTTPAPI(HTTPAPI): 'FakeHTTPAPI.GET url=%r headers=%r body=%r', url, headers, body) + if url.endswith('/status'): + return self._get_status() + + if url.endswith('/res'): + return self._get_resource(headers) + + logging.error('Cannot server url') + assert 0 + + def _get_status(self): + body = { + 'resources': len(self._memb), + } + return FakeResponse(200, {}, body=json.dumps(body)) + + def _get_resource(self, headers): if headers is None: logging.warning('FakeHTTPAPI.GET: no resource id in headers') return FakeResponse(400, {}, 'Missing headers') |