Skip to content

Commit

Permalink
[OpenDataServices/cove#959] Add test of IDName configuration command
Browse files Browse the repository at this point in the history
  • Loading branch information
Bjwebb committed Aug 21, 2018
1 parent 347393d commit 4fe532d
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
Binary file not shown.
23 changes: 23 additions & 0 deletions flattentool/tests/test_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -1257,3 +1257,26 @@ def test_commands_hashcomments(tmpdir):

assert unflattened == {'main': [{'actual': 'actual', 'headings': 'data', 'some': 'some'}, {'actual': 'actual', 'headings': 'Other data', 'some': 'some'}],
'some': 'data'}


def test_commands_id_name(tmpdir):

unflatten(
'flattentool/tests/fixtures/xlsx/commands_id_name.xlsx',
input_format='xlsx',
output_name=tmpdir.join('commands_id_name_unflattened.json').strpath,
cell_source_map=tmpdir.join('commands_id_name_source_map.json').strpath,
heading_source_map=tmpdir.join('commands_id_name_heading_source_map.json').strpath,
metatab_name='Meta',
metatab_vertical_orientation=True
)

unflattened = json.load(tmpdir.join('commands_id_name_unflattened.json'))

assert unflattened == {'someroot': [{'actual': 'actual', 'headings': 'data', 'someId': 'some',
"someArray": [
{"heading1": "more data", "heading2": "other data"},
{"heading1": "more more data", "heading2": "more other data"},
]
}],
'some': 'data'}

0 comments on commit 4fe532d

Please sign in to comment.