From e312917f58542b4c202cb5970f72f49e1e8599f9 Mon Sep 17 00:00:00 2001 From: Victor Uriarte Date: Sun, 22 Jan 2017 23:49:49 -0700 Subject: Add another CLI encoding test This one I couldn't get to pass on my attempt --- tests/test_cli.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/test_cli.py b/tests/test_cli.py index fd73f60..c1a5a75 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -133,3 +133,11 @@ def test_encoding_stdin_gbk(filepath, load_file, capfd): sys.stdin = old_stdin out, _ = capfd.readouterr() assert out == expected + + +def test_encoding(filepath, capsys): + path = filepath('test_cp1251.sql') + expected = u'insert into foo values (1); -- Песня про надежду\n' + sqlparse.cli.main([path, '--encoding=cp1251']) + out, _ = capsys.readouterr() + assert out == expected -- cgit v1.2.1