Skip to content

Commit 6a25130

Browse files
committed
test csv encoding
1 parent 5caeffb commit 6a25130

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

tests/fixtures/csv-encoding-utf16.csv

88 Bytes
Binary file not shown.

tests/test_view.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
#!/usr/bin/env python
2+
# -*- coding: utf-8 -*-
3+
14
import os
25
from nose.tools import eq_
36
from pyexcel_cli.view import view
@@ -26,6 +29,17 @@ def test_stdout_option():
2629
eq_(result.output, '1,2,3\n')
2730

2831

32+
def test_csv_encoding_option():
33+
runner = CliRunner()
34+
test_fixture = os.path.join("tests", "fixtures", "csv-encoding-utf16.csv")
35+
result = runner.invoke(view, ["--output-file-type", "csv",
36+
"--csv-source-encoding", "utf-16",
37+
"--csv-dest-lineterminator", "\n",
38+
test_fixture])
39+
eq_(result.exit_code, 0)
40+
eq_(result.output, 'Äkkilähdöt,Matkakirjoituksia,Matkatoimistot\n')
41+
42+
2943
def test_url_option():
3044
runner = CliRunner()
3145
test_fixture = "https://github.com/pyexcel/pyexcel-cli/raw/master/tests/fixtures/multiple-sheets.xls" # noqa

0 commit comments

Comments
 (0)