@@ -218,6 +218,9 @@ def test_controlpath_token_expansion(self, getpass):
218218Host explicit_host
219219 HostName ohai
220220 ControlPath remoteuser %r host %h orighost %n
221+
222+ Host hashbrowns
223+ ControlPath %C
221224 """
222225 )
223226 result = config .lookup ("explicit_user" )["controlpath" ]
@@ -226,6 +229,9 @@ def test_controlpath_token_expansion(self, getpass):
226229 result = config .lookup ("explicit_host" )["controlpath" ]
227230 # Remote user falls back to local user; host and orighost may differ
228231 assert result == "remoteuser gandalf host ohai orighost explicit_host"
232+ # Supports %C
233+ result = config .lookup ("hashbrowns" )["controlpath" ]
234+ assert result == "fc995d9f41ca1bcec7bc1d7f1ca87b9ff568a6d4"
229235
230236 def test_negation (self ):
231237 config = SSHConfig .from_text (
@@ -280,7 +286,6 @@ def test_proxycommand(self):
280286 def test_identityfile (self ):
281287 config = SSHConfig .from_text (
282288 """
283-
284289IdentityFile id_dsa0
285290
286291Host *
@@ -291,6 +296,9 @@ def test_identityfile(self):
291296
292297Host dsa2*
293298IdentityFile id_dsa22
299+
300+ Host hashbrowns
301+ IdentityFile %C
294302"""
295303 )
296304 for host , values in {
@@ -303,8 +311,15 @@ def test_identityfile(self):
303311 "hostname" : "dsa22" ,
304312 "identityfile" : ["id_dsa0" , "id_dsa1" , "id_dsa22" ],
305313 },
314+ "hashbrowns" : {
315+ "hostname" : "hashbrowns" ,
316+ "identityfile" : [
317+ "id_dsa0" ,
318+ "id_dsa1" ,
319+ "d5c0115d09912e39ff27844ea9d6052fc6048f99" ,
320+ ],
321+ },
306322 }.items ():
307-
308323 assert config .lookup (host ) == values
309324
310325 def test_config_addressfamily_and_lazy_fqdn (self ):
@@ -740,10 +755,10 @@ def test_does_not_match_nonzero_exit_codes(self, run):
740755 @patch ("paramiko.config.getpass" )
741756 @patch ("paramiko.config.invoke.run" )
742757 def test_tokenizes_argument (self , run , getpass , socket ):
743- socket .gethostname .return_value = "local.fqdn"
744758 getpass .getuser .return_value = "gandalf"
745- # Actual exec value is "%d %h %L %l %n %p %r %u"
759+ # Actual exec value is "%C % d %h %L %l %n %p %r %u"
746760 parts = (
761+ "bf5ba06778434a9384ee4217e462f64888bd0cd2" ,
747762 expanduser ("~" ),
748763 "configured" ,
749764 "local" ,
0 commit comments