From 14d47ad922047a9c4d6270f43f09dc615f87e056 Mon Sep 17 00:00:00 2001 From: Roland Walker Date: Fri, 2 Oct 2026 06:10:17 -0400 Subject: [PATCH] use forward-slash /command forms in behave suite for consistency. These are the preferred forms now. --- changelog.md | 1 + test/features/basic_commands.feature | 4 ++-- test/features/iocommands.feature | 6 ++--- test/features/steps/basic_commands.py | 8 +++---- test/features/steps/iocommands.py | 2 +- test/features/steps/named_queries.py | 34 +++++++++++++-------------- 6 files changed, 28 insertions(+), 27 deletions(-) diff --git a/changelog.md b/changelog.md index 9be3977f4..e828b77e6 100644 --- a/changelog.md +++ b/changelog.md @@ -25,6 +25,7 @@ Internal -------- * Replace `pyfzf` dependency with internal implementation. * Use the `uv` outside of the `tox` environment when testing. +* Use forward-slash forms of special commands in the behave test suite. v2.27.0 (2026/09/29) diff --git a/test/features/basic_commands.feature b/test/features/basic_commands.feature index 80df66d5b..2d1aaaf02 100644 --- a/test/features/basic_commands.feature +++ b/test/features/basic_commands.feature @@ -4,8 +4,8 @@ Feature: run the cli, insert the date, exit the cli - Scenario: run "\?" command - When we send "\?" command + Scenario: run "/help" command + When we send "/help" command then we see help output Scenario: run source command diff --git a/test/features/iocommands.feature b/test/features/iocommands.feature index 9095faf21..425a59e79 100644 --- a/test/features/iocommands.feature +++ b/test/features/iocommands.feature @@ -33,15 +33,15 @@ Feature: I/O commands and delimiter is set to "%" Scenario: send output to file - When we query "\o /tmp/output1.sql" + When we query "/once /tmp/output1.sql" and we query "select 123" and we query "system cat /tmp/output1.sql" then we see csv result "123" Scenario: send output to file two times - When we query "\o /tmp/output1.sql" + When we query "/once /tmp/output1.sql" and we query "select 123" - and we query "\o /tmp/output2.sql" + and we query "/once /tmp/output2.sql" and we query "select 456" and we query "system cat /tmp/output2.sql" then we see csv result "456" diff --git a/test/features/steps/basic_commands.py b/test/features/steps/basic_commands.py index 32a2b7905..f04a9f2fa 100644 --- a/test/features/steps/basic_commands.py +++ b/test/features/steps/basic_commands.py @@ -44,14 +44,14 @@ def step_ctrl_o_ctrl_d(context): context.cli.sendline("") -@when(r'we send "\?" command') +@when('we send "/help" command') def step_send_help(context): - r"""Send \? + """Send /help to see help. """ - context.cli.sendline("\\?") + context.cli.sendline("/help") wrappers.expect_exact(context, context.conf["pager_boundary"] + "\r\n", timeout=5) @@ -60,7 +60,7 @@ def step_send_source_command(context): with tempfile.NamedTemporaryFile(prefix=TEMPFILE_PREFIX) as f: f.write(b"SELECT 1") f.flush() - context.cli.sendline(f"\\. {f.name}") + context.cli.sendline(f"/source {f.name}") wrappers.expect_exact(context, context.conf["pager_boundary"] + "\r\n", timeout=5) diff --git a/test/features/steps/iocommands.py b/test/features/steps/iocommands.py index 0792e95f5..370839e62 100644 --- a/test/features/steps/iocommands.py +++ b/test/features/steps/iocommands.py @@ -13,7 +13,7 @@ def step_edit_file(context): context.editor_file_name = os.path.join(context.package_root, f"test_file_{context.conf['vi']}.sql") if os.path.exists(context.editor_file_name): os.remove(context.editor_file_name) - context.cli.sendline(f"\\e {os.path.basename(context.editor_file_name)}") + context.cli.sendline(f"/edit {os.path.basename(context.editor_file_name)}") wrappers.expect_exact(context, 'Entering Ex mode. Type "visual" to go to Normal mode.', timeout=4) wrappers.expect_exact(context, "\r\n:", timeout=4) diff --git a/test/features/steps/named_queries.py b/test/features/steps/named_queries.py index 246d22fbd..53ddf9bc1 100644 --- a/test/features/steps/named_queries.py +++ b/test/features/steps/named_queries.py @@ -13,20 +13,20 @@ @when("we save a named query") def step_save_named_query(context): - """Send \fs command.""" - context.cli.sendline("\\fs foo SELECT 12345") + """Send '/favorite save' command.""" + context.cli.sendline("/favorite save foo SELECT 12345") @when("we use a named query") def step_use_named_query(context): - """Send \f command.""" - context.cli.sendline("\\f foo") + """Send '/favorite run' command.""" + context.cli.sendline("/favorite run foo") @when("we delete a named query") def step_delete_named_query(context): - """Send \fd command.""" - context.cli.sendline("\\fd foo") + """Send '/favorite delete' command.""" + context.cli.sendline("/favorite delete foo") @then("we see the named query saved") @@ -49,14 +49,14 @@ def step_see_named_query_deleted(context): @when("we save a named query with parameters") def step_save_named_query_with_parameters(context): - """Send \fs command for query with parameters.""" - context.cli.sendline('\\fs foo_args SELECT $1, "$2", "$3"') + """Send '/favorite save' command for query with parameters.""" + context.cli.sendline('/favorite save foo_args SELECT $1, "$2", "$3"') @when("we use named query with parameters") def step_use_named_query_with_parameters(context): - """Send \f command with parameters.""" - context.cli.sendline('\\f foo_args 101 second "third value"') + """Send '/favorite run' command with parameters.""" + context.cli.sendline('/favorite run foo_args 101 second "third value"') @then("we see the named query with parameters executed") @@ -67,8 +67,8 @@ def step_see_named_query_with_parameters_executed(context): @when("we use named query with too few parameters") def step_use_named_query_with_too_few_parameters(context): - """Send \f command with missing parameters.""" - context.cli.sendline("\\f foo_args 101") + """Send '/favorite run' command with missing parameters.""" + context.cli.sendline("/favorite run foo_args 101") @then("we see the named query with parameters fail with missing parameters") @@ -79,8 +79,8 @@ def step_see_named_query_with_parameters_fail_with_missing_parameters(context): @when("we use named query with too many parameters") def step_use_named_query_with_too_many_parameters(context): - """Send \f command with extra parameters.""" - context.cli.sendline("\\f foo_args 101 102 103 104") + """Send '/favorite run' command with extra parameters.""" + context.cli.sendline("/favorite run foo_args 101 102 103 104") @then("we see the named query with parameters fail with extra parameters") @@ -91,12 +91,12 @@ def step_see_named_query_with_parameters_fail_with_extra_parameters(context): @when("we save a templated named query") def step_save_templated_named_query(context): - context.cli.sendline("\\fs template SELECT '{{ kv.user }}', '$1'") + context.cli.sendline("/favorite save template SELECT '{{ kv.user }}', '$1'") @when("we use a templated named query with attached values") def step_use_templated_named_query_with_attached_values(context): - context.cli.sendline("\\f template positional --user=henry") + context.cli.sendline("/favorite run template positional --user=henry") @then("we see the attached template values rendered") @@ -106,7 +106,7 @@ def step_see_attached_template_values_rendered(context): @when("we use a templated named query with split values") def step_use_templated_named_query_with_split_values(context): - context.cli.sendline('\\f template second --user "Henry Ford"') + context.cli.sendline('/favorite run template second --user "Henry Ford"') @then("we see the split template values rendered")