Skip to content

Commit e312917

Browse files
committed
Add another CLI encoding test
This one I couldn't get to pass on my attempt
1 parent f6e9141 commit e312917

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tests/test_cli.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,3 +133,11 @@ def test_encoding_stdin_gbk(filepath, load_file, capfd):
133133
sys.stdin = old_stdin
134134
out, _ = capfd.readouterr()
135135
assert out == expected
136+
137+
138+
def test_encoding(filepath, capsys):
139+
path = filepath('test_cp1251.sql')
140+
expected = u'insert into foo values (1); -- Песня про надежду\n'
141+
sqlparse.cli.main([path, '--encoding=cp1251'])
142+
out, _ = capsys.readouterr()
143+
assert out == expected

0 commit comments

Comments
 (0)