diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2021-03-17 19:03:25 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2021-03-17 19:13:27 +0000 |
commit | bd0dfb88fdf5714833466787fd73edaff9740a73 (patch) | |
tree | c53a5ef22f910c748c48a0e0d587755ec6f405b0 /tests/test_sqlexecute.py | |
parent | Releasing debian version 1.5.0-3. (diff) | |
download | litecli-bd0dfb88fdf5714833466787fd73edaff9740a73.tar.xz litecli-bd0dfb88fdf5714833466787fd73edaff9740a73.zip |
Merging upstream version 1.6.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | tests/test_sqlexecute.py | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/tests/test_sqlexecute.py b/tests/test_sqlexecute.py index 2dde4d4..029c64b 100644 --- a/tests/test_sqlexecute.py +++ b/tests/test_sqlexecute.py @@ -102,6 +102,17 @@ def test_unicode_support_in_output(executor): @dbtest +def test_invalid_unicode_values_dont_choke(executor): + run(executor, "create table unicodechars(t text)") + # \xc3 is not a valid utf-8 char. But we can insert it into the database + # which can break querying if not handled correctly. + run(executor, u"insert into unicodechars (t) values (cast(x'c3' as text))") + + results = run(executor, u"select * from unicodechars") + assert_result_equal(results, headers=["t"], rows=[("\\xc3",)]) + + +@dbtest def test_multiple_queries_same_line(executor): results = run(executor, "select 'foo'; select 'bar'") @@ -186,6 +197,7 @@ def test_bind_parameterized_favorite_query(executor): with pytest.raises(ProgrammingError): results = run(executor, "\\f+ q_param 1 2") + @dbtest def test_verbose_feature_of_favorite_query(executor): set_expanded_output(False) @@ -198,11 +210,7 @@ def test_verbose_feature_of_favorite_query(executor): results = run(executor, "\\f sh_param 1") assert_result_equal( - results, - title=None, - headers=["a", "id"], - rows=[("abc", 1)], - auto_status=False, + results, title=None, headers=["a", "id"], rows=[("abc", 1)], auto_status=False, ) results = run(executor, "\\f+ sh_param 1") @@ -214,6 +222,7 @@ def test_verbose_feature_of_favorite_query(executor): auto_status=False, ) + @dbtest def test_shell_parameterized_favorite_query(executor): set_expanded_output(False) |