Skip to content

Commit

Permalink
run linter
Browse files Browse the repository at this point in the history
  • Loading branch information
eevel committed Oct 25, 2022
1 parent e4ba27e commit 176d6d1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/twisted/conch/scripts/ckeygen.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,9 +208,9 @@ def getKeyOrDefault(options):
filename = os.path.expanduser("~/.ssh/id_rsa")
if platform.system() == "Windows":
filename = os.path.expandvars(R"%HOMEPATH %\.ssh\id_rsa")
options["filename"] = input(
"Enter file in which the key is (%s): " % filename
) or filename
options["filename"] = (
input("Enter file in which the key is (%s): " % filename) or filename
)


def printFingerprint(options):
Expand Down
4 changes: 3 additions & 1 deletion src/twisted/conch/test/test_ckeygen.py
Original file line number Diff line number Diff line change
Expand Up @@ -635,9 +635,12 @@ def test_useDefaultForKey(self):
L{options} will default to "~/.ssh/id_rsa" if the user doesn't
specify a key.
"""

def mock_input(*args):
return ""

import builtins

self.patch(builtins, "input", mock_input)
options = {"filename": ""}
getKeyOrDefault(options)
Expand Down Expand Up @@ -669,4 +672,3 @@ def test_handleBadFilePrintFingerprint(self):
options = {"filename": "/foo/bar", "format": "md5-hex"}
with self.assertRaises(SystemExit):
printFingerprint(options)

0 comments on commit 176d6d1

Please sign in to comment.