Skip to content

Commit 765b088

Browse files
committed
Add 360giving csv roundtrip test
1 parent 4a382fc commit 765b088

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

flattentool/tests/test_roundtrip.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def test_roundtrip(tmpdir, output_format):
3232

3333

3434
@pytest.mark.parametrize('use_titles', [False, True])
35-
@pytest.mark.parametrize('output_format', ['xlsx'])#, 'csv'])
35+
@pytest.mark.parametrize('output_format', ['xlsx', 'csv'])
3636
def test_roundtrip_360(tmpdir, output_format, use_titles):
3737
input_name = 'flattentool/tests/fixtures/WellcomeTrust-grants_fixed_2_grants.json'
3838
flatten(
@@ -56,4 +56,10 @@ def test_roundtrip_360(tmpdir, output_format, use_titles):
5656
original_json = json.load(open(input_name))
5757
roundtripped_json = json.load(tmpdir.join('roundtrip.json'))
5858

59+
# Currently not enough information to successfully roundtrip that values
60+
# are numbers, when this is not required by the schema
61+
if output_format == 'csv':
62+
for grant in original_json['grants']:
63+
grant['plannedDates'][0]['duration'] = str(grant['plannedDates'][0]['duration'])
64+
5965
assert original_json == roundtripped_json

0 commit comments

Comments
 (0)