Skip to content

Commit 488484e

Browse files
committed
[#85] Test that array of strings are unflattened correctly
1 parent b773078 commit 488484e

File tree

1 file changed

+33
-1
lines changed

1 file changed

+33
-1
lines changed

flattentool/tests/test_input_SpreadsheetInput_unflatten.py

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,13 @@ def create_schema(root_id):
246246
'title': UNICODE_TEST_STRING,
247247
'type': 'string',
248248
},
249+
'testSA': {
250+
'title': 'SA title',
251+
'type': 'array',
252+
'items': {
253+
'type': 'string'
254+
}
255+
}
249256
}
250257
}
251258
if root_id:
@@ -447,7 +454,32 @@ def create_schema(root_id):
447454
[{
448455
'ROOT_ID': 1
449456
}]
450-
)
457+
),
458+
# Test arrays of strings
459+
(
460+
[{
461+
'ROOT_ID_TITLE': 1,
462+
'Identifier': 2,
463+
'SA title': 'a',
464+
}],
465+
[{
466+
'ROOT_ID': 1,
467+
'id': 2,
468+
'testSA': [ 'a' ],
469+
}]
470+
),
471+
(
472+
[{
473+
'ROOT_ID_TITLE': 1,
474+
'Identifier': 2,
475+
'SA title': 'a;b',
476+
}],
477+
[{
478+
'ROOT_ID': 1,
479+
'id': 2,
480+
'testSA': [ 'a', 'b' ],
481+
}]
482+
),
451483
]
452484

453485
ROOT_ID_PARAMS = [

0 commit comments

Comments
 (0)