@@ -263,7 +263,6 @@ def test_parse_ids_nested(self):
263
263
264
264
265
265
class TestParseUsingSchema (object ):
266
- @pytest .mark .xfail
267
266
def test_sub_sheet_names (self , tmpdir ):
268
267
test_schema = tmpdir .join ('test.json' )
269
268
test_schema .write ('''{
@@ -298,8 +297,8 @@ def test_sub_sheet_names(self, tmpdir):
298
297
{'a' : 'b' }
299
298
]
300
299
assert len (parser .sub_sheets ) == 1
301
- assert list (parser .sub_sheets ['testB ' ]) == list (['ocid' , 'd' , 'f' ])
302
- assert parser .sub_sheets ['testB ' ].lines == [{'d' :'e' }]
300
+ assert list (parser .sub_sheets ['c ' ]) == list (['ocid' , 'c/0/ d' , 'c/0/ f' ])
301
+ assert parser .sub_sheets ['c ' ].lines == [{'c/0/ d' :'e' }]
303
302
304
303
def test_column_matching (self , tmpdir ):
305
304
test_schema = tmpdir .join ('test.json' )
@@ -328,7 +327,6 @@ def test_column_matching(self, tmpdir):
328
327
]
329
328
assert len (parser .sub_sheets ) == 0
330
329
331
- @pytest .mark .xfail
332
330
def test_rollup (self ):
333
331
schema_parser = SchemaParser (root_schema_dict = {
334
332
'properties' : {
@@ -353,15 +351,14 @@ def test_rollup(self):
353
351
schema_parser = schema_parser
354
352
)
355
353
parser .parse ()
356
- assert list (parser .main_sheet ) == [ 'testA[] /testB' ]
354
+ assert list (parser .main_sheet ) == [ 'testA/0 /testB' ]
357
355
assert parser .main_sheet .lines == [
358
- {'testA[] /testB' : '1' }
356
+ {'testA/0 /testB' : '1' }
359
357
]
360
358
assert len (parser .sub_sheets ) == 1
361
- assert set (parser .sub_sheets ['testA' ]) == set (['ocid' , 'testB' , 'testC' ])
362
- assert parser .sub_sheets ['testA' ].lines == [{'testB' :'1' , 'testC' : '2' }]
359
+ assert set (parser .sub_sheets ['testA' ]) == set (['ocid' , 'testA/0/ testB' , 'testA/0/ testC' ])
360
+ assert parser .sub_sheets ['testA' ].lines == [{'testA/0/ testB' :'1' , 'testA/0/ testC' : '2' }]
363
361
364
- @pytest .mark .xfail
365
362
def test_rollup_multiple_values (self , recwarn ):
366
363
schema_parser = SchemaParser (root_schema_dict = {
367
364
'properties' : {
@@ -389,17 +386,17 @@ def test_rollup_multiple_values(self, recwarn):
389
386
schema_parser = schema_parser
390
387
)
391
388
parser .parse ()
392
- assert list (parser .main_sheet ) == [ 'testA[] /testB' ]
389
+ assert list (parser .main_sheet ) == [ 'testA/0 /testB' ]
393
390
assert parser .main_sheet .lines == [
394
391
{
395
- 'testA[] /testB' : 'WARNING: More than one value supplied, consult the relevant sub-sheet for the data.'
392
+ 'testA/0 /testB' : 'WARNING: More than one value supplied, consult the relevant sub-sheet for the data.'
396
393
}
397
394
]
398
395
assert len (parser .sub_sheets ) == 1
399
- assert set (parser .sub_sheets ['testA' ]) == set (['ocid' , 'testB' , 'testC' ])
396
+ assert set (parser .sub_sheets ['testA' ]) == set (['ocid' , 'testA/0/ testB' , 'testA/0/ testC' ])
400
397
assert parser .sub_sheets ['testA' ].lines == [
401
- {'testB' :'1' , 'testC' : '2' },
402
- {'testB' :'3' , 'testC' : '4' }
398
+ {'testA/0/ testB' :'1' , 'testA/0/ testC' : '2' },
399
+ {'testA/0/ testB' :'3' , 'testA/0/ testC' : '4' }
403
400
]
404
401
w = recwarn .pop (UserWarning )
405
402
assert 'Could not provide rollup' in text_type (w .message )
0 commit comments