Skip to content

Commit

Permalink
Merge pull request #2553 from ckan/2553-tsv-autodetect
Browse files Browse the repository at this point in the history
Wrong format autodetected for TSVs prevents DataPusher from being called
  • Loading branch information
David Read committed Aug 12, 2015
2 parents c3a4322 + 1cd1057 commit 79b013b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ckan/config/resource_formats.json
Expand Up @@ -18,7 +18,7 @@
["MDB", "Access Database", "application/x-msaccess", []],
["NetCDF", "NetCDF File", "application/netcdf", []],
["ArcGIS Map Service", "ArcGIS Map Service", "ArcGIS Map Service", ["arcgis map service"]],
["TSV", "Tab Separated Values File", "text/tsv", []],
["TSV", "Tab Separated Values File", "text/tab-separated-values", ["text/tsv"]],
["WFS", "Web Feature Service", null, []],
["ArcGIS Online Map", "ArcGIS Online Map", "ArcGIS Online Map", ["web map application"]],
["Perl", "Perl Script", "text/x-perl", []],
Expand Down
11 changes: 11 additions & 0 deletions ckan/tests/lib/test_helpers.py
Expand Up @@ -109,3 +109,14 @@ def test_includes_existing_license(self):
eq_(dict(licenses)['some-old-license'], 'some-old-license')
# and it is first on the list
eq_(licenses[0][0], 'some-old-license')


class TestResourceFormat(object):

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')

0 comments on commit 79b013b

Please sign in to comment.