summaryrefslogtreecommitdiffstats
path: root/tests/test_main.py
diff options
context:
space:
mode:
authorDavid Szotten <davidszotten@gmail.com>2016-02-02 18:56:20 +0000
committerDavid Szotten <davidszotten@gmail.com>2016-02-02 18:56:20 +0000
commitf6c159e80502c32491cfc99d2ede00613c761212 (patch)
tree8e5f0f1c48929682e66b57f15544eaa25d9cd318 /tests/test_main.py
parentf8ba5c6f54ae44aa5bf74b6ef6a3d9cb871ec524 (diff)
test for recent patch for execute_from_file
to prevent obvious regressions at least
Diffstat (limited to 'tests/test_main.py')
-rw-r--r--tests/test_main.py17
1 files changed, 16 insertions, 1 deletions
diff --git a/tests/test_main.py b/tests/test_main.py
index 1642d1f5..b01c0393 100644
--- a/tests/test_main.py
+++ b/tests/test_main.py
@@ -4,7 +4,10 @@ try:
import setproctitle
except ImportError:
setproctitle = None
-from pgcli.main import obfuscate_process_password, format_output
+
+from pgcli.config import config_location
+from pgcli.main import obfuscate_process_password, format_output, PGCli
+from utils import dbtest, run
@pytest.mark.skipif(platform.system() == 'Windows',
@@ -58,3 +61,15 @@ def test_format_output_auto_expand():
max_width=1)
expanded = ['Title', u'-[ RECORD 0 ]-------------------------\nhead1 | abc\nhead2 | def\n', 'test status']
assert expanded_results == expanded
+
+
+@dbtest
+def test_i_works(tmpdir, executor):
+ sqlfile = tmpdir.join("test.sql")
+ sqlfile.write("SELECT NOW()")
+ cli = PGCli(
+ pgexecute=executor,
+ pgclirc_file=config_location(),
+ )
+ statement = r"\i {}".format(sqlfile)
+ run(executor, statement, pgspecial=cli.pgspecial)