コード例 #1
0
def test_it_detects_a_csv_file():
    (filetype, encoding) = extract.detectType('fixture/simple.csv')
    assert_equals(filetype, 'csv')
コード例 #2
0
def test_it_detects_unicode_csv_file():
    (filetype, encoding) = extract.detectType('fixture/mps_unicode.csv')
    assert_equals(filetype, 'csv')
    assert_equals(encoding, 'utf-8')
コード例 #3
0
def test_it_detects_an_html_csv_file():
    (filetype, encoding) = extract.detectType('fixture/twitter-archive.csv')
    assert_equals(filetype, 'csv')
    assert_equals(encoding, 'ascii')
コード例 #4
0
def test_it_detects_an_xls_file():
    (filetype, encoding) = extract.detectType('fixture/simple.xls')
    assert_equals(filetype, 'xls')
コード例 #5
0
def test_it_detects_an_html_csv_file():
    (filetype, encoding) = extract.detectType('fixture/twitter-archive.csv')
    assert_equals(filetype, 'csv')
    assert_equals(encoding, 'ascii')
コード例 #6
0
def test_it_detects_an_xls_file_with_a_csv_extension():
    (filetype, encoding) = extract.detectType('fixture/really-an-xls.csv')
    assert_equals(filetype, 'xls')
コード例 #7
0
def test_it_detects_a_random_file_with_a_csv_extension():
    (filetype, encoding) = extract.detectType('fixture/really-a-png.csv')
    assert filetype not in ['csv', 'xls', 'xlsx']
コード例 #8
0
def test_it_detects_a_random_file():
    (filetype, encoding) = extract.detectType('fixture/tractor.png')
    assert filetype not in ['csv', 'xls', 'xlsx']
コード例 #9
0
def test_it_detects_an_xlsx_file_that_shows_up_as_a_zip_archive_for_some_reason():
    (filetype, encoding) = extract.detectType('fixture/temperature.xlsx')
    assert_equals(filetype, 'xlsx')
コード例 #10
0
def test_it_detects_a_latin1_csv_file():
    (filetype, encoding) = extract.detectType('fixture/ENH-CCG-spend-2013.csv')
    assert_equals(filetype, 'csv')
    assert_equals(encoding, 'latin-1')
コード例 #11
0
def test_it_detects_a_csv_file():
    (filetype, encoding) = extract.detectType('fixture/simple.csv')
    assert_equals(filetype, 'csv')
コード例 #12
0
def test_it_detects_a_random_file_with_a_csv_extension():
    (filetype, encoding) = extract.detectType("fixture/really-a-png.csv")
    assert filetype not in ["csv", "excel"]
コード例 #13
0
def test_it_detects_a_csv_file_with_an_xls_extension():
    (filetype, encoding) = extract.detectType("fixture/really-a-csv.xls")
    assert_equals(filetype, "csv")
コード例 #14
0
def test_it_detects_a_random_file():
    (filetype, encoding) = extract.detectType("fixture/tractor.png")
    assert filetype not in ["csv", "excel"]
コード例 #15
0
def test_it_detects_an_xlsx_file():
    (filetype, encoding) = extract.detectType("fixture/simple.xlsx")
    assert_equals(filetype, "excel")
コード例 #16
0
def test_it_detects_unicode_csv_file():
    (filetype, encoding) = extract.detectType('fixture/mps_unicode.csv')
    assert_equals(filetype, 'csv')
    assert_equals(encoding, 'utf-8')