From eeff0a63cfb8f72a8479371366aca4c71a483509 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Sat, 9 Mar 2019 10:13:48 +0200 Subject: Add: check that creating resource increments /status count --- effiapi | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'effiapi') diff --git a/effiapi b/effiapi index bb1af9e..5575a37 100755 --- a/effiapi +++ b/effiapi @@ -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') -- cgit v1.2.1