Skip to content
This repository has been archived by the owner on Jan 22, 2021. It is now read-only.

Commit

Permalink
update some unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
garaud committed Oct 20, 2020
1 parent 857479b commit 5459cee
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions tests/test_webapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@
from datetime import date, datetime, timedelta

import pytest

from jitenshea.webapi import ISO_DATE, ISO_DATETIME, api
from jitenshea.webapp import app
from jitenshea.webapi import api, ISO_DATE, ISO_DATETIME


app.config['TESTING'] = True
api.init_app(app)
Expand Down Expand Up @@ -156,7 +154,7 @@ def test_api_prediction(client):
assert resp.status_code == 200
data = resp.get_json()
# 3 values by default
assert len(data) == 3
assert len(data) == 5
assert 'nb_bikes' in data[0]
assert data[0]['at'] == '1H'

Expand All @@ -183,7 +181,7 @@ def test_api_latest_prediction(client):
assert resp.status_code == 200
data = resp.get_json()['data']
date = resp.get_json()['date']
assert len(data) == 100
assert len(data) >= 100
# in GeoJSON
resp = client.get('/api/bordeaux/predict/station',
query_string={'limit': 5, 'geojson': True})
Expand Down

0 comments on commit 5459cee

Please sign in to comment.