def test_it_detects_a_csv_file():
    (filetype, encoding) = extract.detectType('fixture/simple.csv')
    assert_equals(filetype, 'csv')
def test_it_detects_unicode_csv_file():
    (filetype, encoding) = extract.detectType('fixture/mps_unicode.csv')
    assert_equals(filetype, 'csv')
    assert_equals(encoding, 'utf-8')
def test_it_detects_an_html_csv_file():
    (filetype, encoding) = extract.detectType('fixture/twitter-archive.csv')
    assert_equals(filetype, 'csv')
    assert_equals(encoding, 'ascii')
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')
def test_it_detects_an_xls_file_with_a_csv_extension():
    (filetype, encoding) = extract.detectType('fixture/really-an-xls.csv')
    assert_equals(filetype, 'xls')
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']
def test_it_detects_a_random_file():
    (filetype, encoding) = extract.detectType('fixture/tractor.png')
    assert filetype not in ['csv', 'xls', 'xlsx']
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')
def test_it_detects_a_csv_file():
    (filetype, encoding) = extract.detectType('fixture/simple.csv')
    assert_equals(filetype, 'csv')
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"]
def test_it_detects_a_csv_file_with_an_xls_extension():
    (filetype, encoding) = extract.detectType("fixture/really-a-csv.xls")
    assert_equals(filetype, "csv")
def test_it_detects_a_random_file():
    (filetype, encoding) = extract.detectType("fixture/tractor.png")
    assert filetype not in ["csv", "excel"]
def test_it_detects_an_xlsx_file():
    (filetype, encoding) = extract.detectType("fixture/simple.xlsx")
    assert_equals(filetype, "excel")
def test_it_detects_unicode_csv_file():
    (filetype, encoding) = extract.detectType('fixture/mps_unicode.csv')
    assert_equals(filetype, 'csv')
    assert_equals(encoding, 'utf-8')