summaryrefslogtreecommitdiffstats
path: root/tests/test_main.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-11-01 04:38:03 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-11-01 04:38:03 +0000
commitfa11d0da51045077b543d42a1ab661c4a20b5127 (patch)
treeaac9e87c59cb8bc7e3cd429e9200c3ca017cb591 /tests/test_main.py
parentAdding upstream version 3.5.0. (diff)
downloadpgcli-upstream.tar.xz
pgcli-upstream.zip
Adding upstream version 4.0.1.upstream/4.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/test_main.py')
-rw-r--r--tests/test_main.py18
1 files changed, 16 insertions, 2 deletions
diff --git a/tests/test_main.py b/tests/test_main.py
index 9b3a84b..cbf20a6 100644
--- a/tests/test_main.py
+++ b/tests/test_main.py
@@ -216,7 +216,6 @@ def pset_pager_mocks():
with mock.patch("pgcli.main.click.echo") as mock_echo, mock.patch(
"pgcli.main.click.echo_via_pager"
) as mock_echo_via_pager, mock.patch.object(cli, "prompt_app") as mock_app:
-
yield cli, mock_echo, mock_echo_via_pager, mock_app
@@ -298,6 +297,22 @@ def test_i_works(tmpdir, executor):
@dbtest
+def test_echo_works(executor):
+ cli = PGCli(pgexecute=executor)
+ statement = r"\echo asdf"
+ result = run(executor, statement, pgspecial=cli.pgspecial)
+ assert result == ["asdf"]
+
+
+@dbtest
+def test_qecho_works(executor):
+ cli = PGCli(pgexecute=executor)
+ statement = r"\qecho asdf"
+ result = run(executor, statement, pgspecial=cli.pgspecial)
+ assert result == ["asdf"]
+
+
+@dbtest
def test_watch_works(executor):
cli = PGCli(pgexecute=executor)
@@ -371,7 +386,6 @@ def test_quoted_db_uri(tmpdir):
def test_pg_service_file(tmpdir):
-
with mock.patch.object(PGCli, "connect") as mock_connect:
cli = PGCli(pgclirc_file=str(tmpdir.join("rcfile")))
with open(tmpdir.join(".pg_service.conf").strpath, "w") as service_conf: