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

Commit

Permalink
api: fix a wrong name in the clustured_station_geojson function
Browse files Browse the repository at this point in the history
* rename 'nom' to 'name'
* update the dedicated unit test
  • Loading branch information
garaud committed May 26, 2018
1 parent fa35760 commit 3829997
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion jitenshea/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ def time_window(day, window, backward):
order_reference_date = start
return TimeWindow(start, stop, order_reference_date)


def station_geojson(stations):
"""Process station data into GeoJSON
"""
Expand Down Expand Up @@ -137,7 +138,7 @@ def clustered_station_geojson(stations):
"properties": {
"id": data['id'],
"cluster_id": data['cluster_id'],
"name": data['nom'],
"name": data['name'],
"start": data['start'],
"stop": data['stop']
}})
Expand Down
3 changes: 3 additions & 0 deletions tests/test_webapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ def test_api_clustering_stations(client):
data = json.loads(resp.data)['data']
# there are just 4 clusters
assert {0, 1, 2, 3} == set(x['cluster_id'] for x in data)
resp = client.get('/api/bordeaux/clustering/stations',
query_string={"geojson": True})
assert resp.status_code == 200


def test_api_clustering_centroids(client):
Expand Down

0 comments on commit 3829997

Please sign in to comment.