Exemplo n.º 1
0
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"
Exemplo n.º 2
0
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
Exemplo n.º 3
0
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"
Exemplo n.º 4
0
def test_errors():
    with pytest.raises(URLParseError) as e:
        URL("foo")
Exemplo n.º 5
0
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"
Exemplo n.º 6
0
def test_deploy(tmpdir):
    local = tmpdir.mkdir("local")
    remote = tmpdir.mkdir("remote")

    deploy(local.strpath, URL("ssh://localhost/" + remote.strpath))
Exemplo n.º 7
0
def test_errors():
    # pylint: disable-msg=E1101
    with pytest.raises(URLParseError) as e:
        URL("foo")
Exemplo n.º 8
0
def test_errors():
    """ Test Errors """
    with pytest.raises(URLParseError):
        URL("foo")