Adding upstream version 4.1.0.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
5f14fad9bf
commit
be6a09053d
14 changed files with 456 additions and 36 deletions
17
tests/test_application_name.py
Normal file
17
tests/test_application_name.py
Normal file
|
@ -0,0 +1,17 @@
|
|||
from unittest.mock import patch
|
||||
|
||||
from click.testing import CliRunner
|
||||
|
||||
from pgcli.main import cli
|
||||
from pgcli.pgexecute import PGExecute
|
||||
|
||||
|
||||
def test_application_name_in_env():
|
||||
runner = CliRunner()
|
||||
app_name = "wonderful_app"
|
||||
with patch.object(PGExecute, "__init__") as mock_pgxecute:
|
||||
runner.invoke(
|
||||
cli, ["127.0.0.1:5432/hello", "user"], env={"PGAPPNAME": app_name}
|
||||
)
|
||||
kwargs = mock_pgxecute.call_args.kwargs
|
||||
assert kwargs.get("application_name") == app_name
|
Loading…
Add table
Add a link
Reference in a new issue