-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#41: added method for converting the .edtr to .json
- Loading branch information
Showing
2 changed files
with
25 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,7 +21,7 @@ | |
|
||
from pcapi.server import application | ||
from pcapi import config | ||
from pcapi.utils.pcapi_upgrade import find_json, updateIdInGeojson | ||
from pcapi.utils.pcapi_upgrade import find_json, updateIdInGeojson, updateEditorExtension | ||
|
||
userid = "[email protected]" | ||
|
||
|
@@ -47,3 +47,11 @@ def test_updateIdInGeojson(self): | |
new_record = updateIdInGeojson(record) | ||
self.assertEquals(new_record["properties"]["fields"][0]["id"], | ||
record["properties"]["fields"][0]["id"].replace("fieldcontain-", "")) | ||
|
||
def test_updateEditorExtension(self): | ||
""" read geojson and check if editor extension has changed""" | ||
gen = find_json(envsys_records_dir) | ||
record = json.load(open(gen.next())) | ||
new_record = updateEditorExtension(record) | ||
self.assertEquals(new_record["properties"]["editor"], | ||
record["properties"]["editor"].replace(".edtr", ".json")) |