def test_autodetect_tsv(self): eq_(h.unified_resource_format('tsv'), 'TSV') eq_(h.unified_resource_format('text/tab-separated-values'), 'TSV') eq_(h.unified_resource_format('text/tsv'), 'TSV')
def clean_format(format): return h.unified_resource_format(format)
def test_unified_resource_format(fmt, exp): assert h.unified_resource_format(fmt) == exp
def test_unified_resource_format_by_alternative_description2(self): eq_(h.unified_resource_format('Excel'), 'XLS')
def test_unified_resource_format_by_alternative_description(self): eq_(h.unified_resource_format('application/msexcel'), 'XLS')
def test_unified_resource_format_by_primary_mimetype(self): eq_(h.unified_resource_format('application/vnd.ms-excel'), 'XLS')
def test_unified_resource_format_by_description(self): eq_(h.unified_resource_format('Excel document'), 'XLS')
def test_unified_resource_format_by_extension(self): eq_(h.unified_resource_format('xls'), 'XLS')
def clean_format(format: str): """Normalize resource's format. """ return h.unified_resource_format(format)