File: test_convert.py

package info (click to toggle)
csvkit 2.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 40,664 kB
  • sloc: python: 4,924; perl: 1,000; makefile: 131; sql: 4
file content (30 lines) | stat: -rw-r--r-- 915 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import unittest

from csvkit import convert


class TestConvert(unittest.TestCase):

    def test_guess_fixed(self):
        self.assertEqual('fixed', convert.guess_format('testdata'))

    def test_guess_xls(self):
        self.assertEqual('xls', convert.guess_format('testdata.xls'))

    def test_guess_xls_uppercase(self):
        self.assertEqual('xls', convert.guess_format('testdata.XLS'))

    def test_guess_xlsx(self):
        self.assertEqual('xlsx', convert.guess_format('testdata.xlsx'))

    def test_guess_csv(self):
        self.assertEqual('csv', convert.guess_format('testdata.csv'))

    def test_guess_dbf(self):
        self.assertEqual('dbf', convert.guess_format('testdata.dbf'))

    def test_guess_json(self):
        self.assertEqual('json', convert.guess_format('testdata.json'))

    def test_guess_invalid(self):
        self.assertEqual(None, convert.guess_format('testdata.invalid'))