def test_get_host(self): scp = Scp(self.get_data()) assert scp._get_host("http://localhost/index") == "localhost" assert scp._get_host("https://localhost/index") == "localhost"
def test_get_host_exception(self): scp = Scp(self.get_data()) with pytest.raises(Exception) as inst: scp._get_host("abcde123445") assert str(inst.value) == "The host abcde123445 informed is not valid for openssh."