def test_simple_url_with_remote_dir(): """ Test Simple Url With Remote Dir """ url = URL("foo@bar:deploy") assert url.host == "bar" assert url.user == "foo" assert url.port == 22 assert url.remote_directory == "deploy"
def test_simple_url(): url = URL("foo@bar") assert url.as_string == "foo@bar" assert url.host == "bar" assert url.user == "foo" assert url.port == 22 assert url.remote_directory is None
def test_modern_urls(): """ Test Modern Urls """ url = URL("ssh://foo@bar/deploy") assert url.host == "bar" assert url.user == "foo" assert url.port == 22 assert url.remote_directory == "deploy" url = URL("ssh://foo@bar") assert url.host == "bar" assert url.user == "foo" assert url.port == 22 assert url.remote_directory is None url = URL("ssh://foo@bar:2222/deploy") assert url.host == "bar" assert url.user == "foo" assert url.port == 2222 assert url.remote_directory == "deploy"
def test_errors(): with pytest.raises(URLParseError) as e: URL("foo")
def test_simple_url_with_remote_dir(): url = URL("foo@bar:deploy") assert url.host == "bar" assert url.user == "foo" assert url.port == 22 assert url.remote_directory == "deploy"
def test_deploy(tmpdir): local = tmpdir.mkdir("local") remote = tmpdir.mkdir("remote") deploy(local.strpath, URL("ssh://localhost/" + remote.strpath))
def test_errors(): # pylint: disable-msg=E1101 with pytest.raises(URLParseError) as e: URL("foo")
def test_errors(): """ Test Errors """ with pytest.raises(URLParseError): URL("foo")