Skip to content

Commit

Permalink
Helps to actually leverage your mocked system calls
Browse files Browse the repository at this point in the history
  • Loading branch information
bitprophet committed Mar 12, 2022
1 parent 29d7bf4 commit 02ad67e
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions tests/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ def test_proxycommand_tilde_expansion(self):
assert got == expected

@patch("paramiko.config.getpass")
def test_controlpath_token_expansion(self, getpass):
def test_controlpath_token_expansion(self, getpass, socket):
getpass.getuser.return_value = "gandalf"
config = SSHConfig.from_text(
"""
Expand All @@ -231,7 +231,7 @@ def test_controlpath_token_expansion(self, getpass):
assert result == "remoteuser gandalf host ohai orighost explicit_host"
# Supports %C
result = config.lookup("hashbrowns")["controlpath"]
assert result == "fc995d9f41ca1bcec7bc1d7f1ca87b9ff568a6d4"
assert result == "a438e7dbf5308b923aba9db8fe2ca63447ac8688"

def test_negation(self):
config = SSHConfig.from_text(
Expand Down Expand Up @@ -283,7 +283,9 @@ def test_proxycommand(self):

assert config.lookup(host) == values

def test_identityfile(self):
@patch("paramiko.config.getpass")
def test_identityfile(self, getpass, socket):
getpass.getuser.return_value = "gandalf"
config = SSHConfig.from_text(
"""
IdentityFile id_dsa0
Expand Down Expand Up @@ -316,7 +318,7 @@ def test_identityfile(self):
"identityfile": [
"id_dsa0",
"id_dsa1",
"d5c0115d09912e39ff27844ea9d6052fc6048f99",
"a438e7dbf5308b923aba9db8fe2ca63447ac8688",
],
},
}.items():
Expand Down

0 comments on commit 02ad67e

Please sign in to comment.