Add test for empty block_id parameter for votes API

This commit is contained in:
Brett Sun 2017-01-13 18:07:12 +01:00
parent b1d6d356cb
commit 7071d471a5

View File

@ -48,6 +48,10 @@ def test_get_votes_endpoint_multiple_votes(b, client):
@pytest.mark.bdb @pytest.mark.bdb
def test_get_votes_endpoint_returns_empty_list_not_found(client): def test_get_votes_endpoint_returns_empty_list_not_found(client):
res = client.get(VOTES_ENDPOINT + "?block_id=")
assert [] == res.json
assert res.status_code == 200
res = client.get(VOTES_ENDPOINT + "?block_id=123") res = client.get(VOTES_ENDPOINT + "?block_id=123")
assert [] == res.json assert [] == res.json
assert res.status_code == 200 assert res.status_code == 200