diff --git a/changelog.md b/changelog.md index 772cbf58..810a9019 100644 --- a/changelog.md +++ b/changelog.md @@ -4,6 +4,7 @@ Upcoming (TBD) Internal --------- * Require `sqlglot` 30.x. +* Connect toolbar tests to the test database. 1.65.0 (2026/03/16) diff --git a/test/test_clitoolbar.py b/test/test_clitoolbar.py index 3e379ec2..ae645935 100644 --- a/test/test_clitoolbar.py +++ b/test/test_clitoolbar.py @@ -1,22 +1,64 @@ +# type: ignore + from prompt_toolkit.shortcuts import PromptSession from mycli.clitoolbar import create_toolbar_tokens_func from mycli.main import MyCli +from mycli.sqlexecute import SQLExecute +from test.utils import HOST, PASSWORD, PORT, USER, dbtest +@dbtest def test_create_toolbar_tokens_func_initial(): m = MyCli() + m.sqlexecute = SQLExecute( + None, + USER, + PASSWORD, + HOST, + PORT, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + ) m.prompt_app = PromptSession() iteration = 0 f = create_toolbar_tokens_func(m, lambda: iteration == 0, m.toolbar_format) result = f() + m.close() assert any("right-arrow accepts full-line suggestion" in token for token in result) +@dbtest def test_create_toolbar_tokens_func_short(): m = MyCli() + m.sqlexecute = SQLExecute( + None, + USER, + PASSWORD, + HOST, + PORT, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + ) m.prompt_app = PromptSession() iteration = 1 f = create_toolbar_tokens_func(m, lambda: iteration == 0, m.toolbar_format) result = f() + m.close() assert not any("right-arrow accepts full-line suggestion" in token for token in result)