diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-11-15 06:46:32 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-11-15 06:46:32 +0000 |
commit | 570030879001869cc11575fc1869176719aa99f8 (patch) | |
tree | 1f2c4f2fd1864ef6bcd85da10c4c7dfac8f8b217 /tests/test_dbspecial.py | |
parent | Releasing debian version 1.12.3-1. (diff) | |
download | litecli-570030879001869cc11575fc1869176719aa99f8.tar.xz litecli-570030879001869cc11575fc1869176719aa99f8.zip |
Merging upstream version 1.12.4.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/test_dbspecial.py')
-rw-r--r-- | tests/test_dbspecial.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/test_dbspecial.py b/tests/test_dbspecial.py index d3c7c07..5c43fac 100644 --- a/tests/test_dbspecial.py +++ b/tests/test_dbspecial.py @@ -2,6 +2,7 @@ from litecli.packages.completion_engine import suggest_type from test_completion_engine import sorted_dicts from litecli.packages.special.utils import format_uptime from litecli.packages.special.utils import check_if_sqlitedotcommand +from utils import run, dbtest, assert_result_equal def test_import_first_argument(): @@ -88,3 +89,21 @@ def test_check_if_sqlitedotcommand(): ] for command, expected_result in test_cases: assert check_if_sqlitedotcommand(command) == expected_result + + +@dbtest +def test_special_d(executor): + run(executor, """create table tst_tbl1(a text)""") + results = run(executor, """\\d""") + + assert_result_equal(results, headers=["name"], rows=[("tst_tbl1",)], status="") + + +@dbtest +def test_special_d_w_arg(executor): + run(executor, """create table tst_tbl1(a text)""") + results = run(executor, """\\d tst_tbl1""") + + assert_result_equal( + results, headers=["cid", "name", "type", "notnull", "dflt_value", "pk"], rows=[(0, "a", "TEXT", 0, None, 0)], status="" + ) |