update more tests

This commit is contained in:
Jonathan Wren 2020-10-10 17:04:25 -07:00
parent 9116b63d8a
commit 7368cd61cc
No known key found for this signature in database
GPG key ID: 43D5FF8722E7F68A
7 changed files with 372 additions and 112 deletions

View file

@ -177,13 +177,20 @@ def open_editor_and_enter(context, method, text=""):
return tmpfile
if "password" in context:
password = context.password
else:
password = ""
# fmt: off
# see: https://github.com/psf/black/issues/664
with \
patch("subprocess.call", side_effect=_mock_editor) as mock_editor, \
patch("getpass.getpass", side_effect=_mock_getpass(password)) as mock_getpass, \
patch("sys.stdin.isatty", return_value=True) \
:
context.editor = mock_editor
context.getpass = mock_getpass
cli(["--edit"])
# fmt: on