Skip to content

Commit 068997e

Browse files
committed
[#90] Fix unflattening tests using the schema
1 parent 5d8047e commit 068997e

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

flattentool/schema.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ def parse_schema_dict(self, parent_path, schema_dict, parent_id_fields=None, tit
148148
raise ValueError
149149
elif 'object' in type_set:
150150
if title:
151-
title_lookup[title].property_name = property_name+'/0'
151+
title_lookup[title].property_name = property_name
152152

153153
sub_sheet_name = ('_'.join(x[:3] for x in parent_path.split('/') if x != '0') + property_name)[:31]
154154

flattentool/tests/test_input_SpreadsheetInput_unflatten.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ def create_schema(root_id):
399399
}]
400400
}]
401401
),
402-
pytest.mark.xfail((
402+
(
403403
'Multi item array, allow numbering',
404404
[{
405405
'ROOT_ID_TITLE': 1,
@@ -428,7 +428,7 @@ def create_schema(root_id):
428428
}
429429
]
430430
}]
431-
)),
431+
),
432432
(
433433
'Empty',
434434
[{

flattentool/tests/test_input_SpreadsheetInput_unflatten_mulitplesheets.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ def test_nested_id(self):
144144
{'ocid': 1, 'id': 2, 'subField': [{'id': 3, 'testA': {'id': 4}}]}
145145
]
146146

147-
@pytest.mark.xfail()
147+
@pytest.mark.xfail
148148
def test_missing_columns(self, recwarn):
149149
spreadsheet_input = ListInput(
150150
sheets={
@@ -158,14 +158,14 @@ def test_missing_columns(self, recwarn):
158158
{
159159
'ocid': 1,
160160
'id': '',
161-
'subField/id': 3,
162-
'subField/testA/id': 4,
161+
'subField/0/id': 3,
162+
'subField/0/testA/id': 4,
163163
},
164164
{
165165
'ocid': 1,
166166
'id': 2,
167-
'subField/id': 3,
168-
'subField/testA': 5,
167+
'subField/0/id': 3,
168+
'subField/0/testA': 5,
169169
}
170170
]
171171
},

0 commit comments

Comments
 (0)