예제 #1
0
def test_version_control__get_url_rev_and_auth__no_revision(url: str) -> None:
    """
    Test passing a URL to VersionControl.get_url_rev_and_auth() with
    empty revision
    """
    with pytest.raises(InstallationError) as excinfo:
        VersionControl.get_url_rev_and_auth(url)

    assert "an empty revision (after @)" in str(excinfo.value)
예제 #2
0
def test_version_control__get_url_rev_and_auth__missing_plus(url: str) -> None:
    """
    Test passing a URL to VersionControl.get_url_rev_and_auth() with a "+"
    missing from the scheme.
    """
    with pytest.raises(ValueError) as excinfo:
        VersionControl.get_url_rev_and_auth(url)

    assert "malformed VCS url" in str(excinfo.value)
예제 #3
0
def test_version_control__get_url_rev_and_auth(
        url: str, expected: Tuple[str, None, Tuple[None, None]]) -> None:
    """
    Test the basic case of VersionControl.get_url_rev_and_auth().
    """
    actual = VersionControl.get_url_rev_and_auth(url)
    assert actual == expected
예제 #4
0
파일: test_vcs.py 프로젝트: Martinn1996/pip
def test_version_control__get_url_rev_and_auth(url, expected):
    """
    Test the basic case of VersionControl.get_url_rev_and_auth().
    """
    actual = VersionControl.get_url_rev_and_auth(url)
    assert actual == expected