def test_csv_input_utf16(self, tmpdir):
     main = tmpdir.join("main.csv")
     main.write_text("colA\néαГ😼𝒞人", encoding="utf16")
     csvinput = CSVInput(input_name=tmpdir.strpath)
     csvinput.encoding = "utf16"
     csvinput.read_sheets()
     assert list(csvinput.get_sheet_lines("main")) == [{"colA": "éαГ😼𝒞人"}]
     assert csvinput.sub_sheet_names == ["main"]
Exemplo n.º 2
0
 def test_csv_input_utf16(self, tmpdir):
     main = tmpdir.join('main.csv')
     main.write_text('colA\néαГ😼𝒞人', encoding='utf16')
     csvinput = CSVInput(input_name=tmpdir.strpath, main_sheet_name='main')
     csvinput.encoding = 'utf16'
     csvinput.read_sheets()
     assert list(csvinput.get_main_sheet_lines()) == \
         [{'colA': 'éαГ😼𝒞人'}]
     assert csvinput.sub_sheet_names == []
 def test_csv_input_latin1(self, tmpdir):
     main = tmpdir.join('main.csv')
     main.write_text('colA\né', encoding='latin-1')
     csvinput = CSVInput(input_name=tmpdir.strpath)
     csvinput.encoding = 'latin-1'
     csvinput.read_sheets()
     assert list(csvinput.get_sheet_lines('main')) == \
         [{'colA': 'é'}]
     assert csvinput.sub_sheet_names == ['main']
Exemplo n.º 4
0
 def test_csv_input_utf16(self, tmpdir):
     main = tmpdir.join('main.csv')
     main.write_text('colA\néαГ😼𝒞人', encoding='utf16')
     csvinput = CSVInput(input_name=tmpdir.strpath)
     csvinput.encoding = 'utf16'
     csvinput.read_sheets()
     assert list(csvinput.get_sheet_lines('main')) == \
         [{'colA': 'éαГ😼𝒞人'}]
     assert csvinput.sub_sheet_names == ['main']
Exemplo n.º 5
0
 def test_csv_input_latin1(self, tmpdir):
     main = tmpdir.join('main.csv')
     main.write_text('colA\né', encoding='latin-1')
     csvinput = CSVInput(input_name=tmpdir.strpath, main_sheet_name='main')
     csvinput.encoding = 'latin-1'
     csvinput.read_sheets()
     assert list(csvinput.get_main_sheet_lines()) == \
         [{'colA': 'é'}]
     assert csvinput.sub_sheet_names == []