From 02ad67eaec68bacc18838158b902ccaade8f5dc8 Mon Sep 17 00:00:00 2001 From: Jeff Forcier Date: Fri, 11 Mar 2022 21:21:26 -0500 Subject: Helps to actually leverage your mocked system calls --- tests/test_config.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'tests') diff --git a/tests/test_config.py b/tests/test_config.py index 08096cff..b46dc7b4 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -207,7 +207,7 @@ Host test 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( """ @@ -231,7 +231,7 @@ Host hashbrowns 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( @@ -283,7 +283,9 @@ ProxyCommand foo=bar:%h-%p 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 @@ -316,7 +318,7 @@ IdentityFile %C "identityfile": [ "id_dsa0", "id_dsa1", - "d5c0115d09912e39ff27844ea9d6052fc6048f99", + "a438e7dbf5308b923aba9db8fe2ca63447ac8688", ], }, }.items(): -- cgit v1.2.3