diff options
Diffstat (limited to 'tests/test_config.py')
-rw-r--r-- | tests/test_config.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/test_config.py b/tests/test_config.py index 7c86667a..5e9aa059 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -467,6 +467,10 @@ Host * cmd = config.lookup("some-random-host")["proxycommand"] assert cmd == "default-proxy" + def test_hostname_tokenization(self): + result = load_config("hostname-tokenized").lookup("whatever") + assert result["hostname"] == "prefix.whatever" + class TestSSHConfigDict(object): def test_SSHConfigDict_construct_empty(self): @@ -774,6 +778,12 @@ class TestMatchExec(object): with raises(ConfigParseError): load_config("match-exec-no-arg") + @patch("paramiko.config.invoke.run") + def test_works_with_tokenized_hostname(self, run): + run.side_effect = _expect("ping target") + result = load_config("hostname-exec-tokenized").lookup("target") + assert result["hostname"] == "pingable.target" + class TestMatchHost(object): def test_matches_target_name_when_no_hostname(self): |