예제 #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"
예제 #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
예제 #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"
예제 #4
0
def test_errors():
    with pytest.raises(URLParseError) as e:
        URL("foo")
예제 #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"
예제 #6
0
def test_deploy(tmpdir):
    local = tmpdir.mkdir("local")
    remote = tmpdir.mkdir("remote")

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