Skip to content

Commit 484d3cb

Browse files
committed
adds: tests for csv
1 parent 6536681 commit 484d3cb

3 files changed

Lines changed: 7 additions & 0 deletions

File tree

geoclustering/encoding.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ def visitor(self, cluster_id, cluster):
8989
self.state,
9090
fieldnames=["cluster_id"] + list(cluster[0].keys()),
9191
quoting=csv.QUOTE_NONNUMERIC,
92+
lineterminator="\n",
9293
)
9394
self.writer.writeheader()
9495

tests/encoding.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,4 @@ def test_encoders():
2727
assert res["string"] == read_fixture_content("snapshots/result.txt")
2828
assert res["json"] == read_fixture_content("snapshots/result.json")
2929
assert res["geojson"] == read_fixture_content("snapshots/result.geojson")
30+
assert res["csv"] == read_fixture_content("snapshots/result.csv")
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
"cluster_id","id","name","lat","lon"
2+
0,1,"Alice",52.523955,13.442362
3+
0,2,"Bob",52.526659,13.448097
4+
1,3,"Carol",52.525626,13.419246
5+
1,4,"Dan",52.52443559865125,13.41261723049818

0 commit comments

Comments
 (0)