def test_formats(array_spec): for fmt, sep in COLLECTION_FORMATS.iteritems(): array_spec['collectionFormat'] = fmt result = marshal_collection_format(array_spec, [1, 2, 3]) assert sep.join(['1', '2', '3']) == result
def test_formats(array_spec): for fmt, sep in COLLECTION_FORMATS.iteritems(): array_spec['collectionFormat'] = fmt param_value = sep.join(['1', '2', '3']) assert [1, 2, 3] == unmarshal_collection_format(array_spec, param_value)