prefix api endpoints

This commit is contained in:
Yax 2022-01-30 18:57:39 +01:00
parent 9b2c14e3a0
commit 91b4dc9e2a
2 changed files with 9 additions and 9 deletions

View file

@ -31,27 +31,27 @@ def client():
def test_api_ping(client):
resp = client.get('/ping')
resp = client.get('/api/ping')
assert resp.data == b"OK"
def test_api_count_global(client):
resp = client.get('/comments/count')
resp = client.get('/api/comments/count')
d = json.loads(resp.data)
assert d and d['count'] == 2
def test_api_count_url(client):
resp = client.get('/comments/count?url=/site1')
resp = client.get('/api/comments/count?url=/site1')
d = json.loads(resp.data)
assert d and d['count'] == 1
resp = client.get('/comments/count?url=/site2')
resp = client.get('/api/comments/count?url=/site2')
d = json.loads(resp.data)
assert d and d['count'] == 0
def test_api_comment(client):
resp = client.get('/comments?url=/site1')
resp = client.get('/api/comments?url=/site1')
d = json.loads(resp.data)
assert d and len(d['data']) == 1
comment = d['data'][0]
@ -60,6 +60,6 @@ def test_api_comment(client):
def test_api_comment_not_found(client):
resp = client.get('/comments?url=/site2')
resp = client.get('/api/comments?url=/site2')
d = json.loads(resp.data)
assert d and d['data'] == []