Ejemplo n.º 1
0
def test_parse_editable_local(
        isdir_mock, exists_mock, abspath_mock):
    exists_mock.return_value = isdir_mock.return_value = True
    # mocks needed to support path operations on windows tests
    abspath_mock.return_value = "/some/path"
    assert parse_editable('.') == (None, 'file:///some/path', None)
    abspath_mock.return_value = "/some/path/foo"
    assert parse_editable('foo') == (
        None, 'file:///some/path/foo', None,
    )
Ejemplo n.º 2
0
def test_parse_editable_local_extras(
        isdir_mock, exists_mock, abspath_mock):
    exists_mock.return_value = isdir_mock.return_value = True
    abspath_mock.return_value = "/some/path"
    assert parse_editable('.[extras]') == (
        None, 'file://' + "/some/path", {'extras'},
    )
    abspath_mock.return_value = "/some/path/foo"
    assert parse_editable('foo[bar,baz]') == (
        None, 'file:///some/path/foo', {'bar', 'baz'},
    )
Ejemplo n.º 3
0
def test_parse_editable_local(isdir_mock: mock.Mock, exists_mock: mock.Mock,
                              abspath_mock: mock.Mock) -> None:
    exists_mock.return_value = isdir_mock.return_value = True
    # mocks needed to support path operations on windows tests
    abspath_mock.return_value = "/some/path"
    assert parse_editable(".") == (None, "file:///some/path", set())
    abspath_mock.return_value = "/some/path/foo"
    assert parse_editable("foo") == (
        None,
        "file:///some/path/foo",
        set(),
    )
Ejemplo n.º 4
0
def test_parse_editable_local_extras(isdir_mock: mock.Mock,
                                     exists_mock: mock.Mock,
                                     abspath_mock: mock.Mock) -> None:
    exists_mock.return_value = isdir_mock.return_value = True
    abspath_mock.return_value = "/some/path"
    assert parse_editable(".[extras]") == (
        None,
        "file:///some/path",
        {"extras"},
    )
    abspath_mock.return_value = "/some/path/foo"
    assert parse_editable("foo[bar,baz]") == (
        None,
        "file:///some/path/foo",
        {"bar", "baz"},
    )
Ejemplo n.º 5
0
def test_parse_editable_vcs_extras():
    assert parse_editable('svn+https://foo#egg=foo[extras]') == (
        'foo[extras]',
        'svn+https://foo#egg=foo[extras]',
        None,
    )
Ejemplo n.º 6
0
def test_parse_editable_explicit_vcs():
    assert parse_editable('svn+https://foo#egg=foo') == (
        'foo',
        'svn+https://foo#egg=foo',
        None,
    )
Ejemplo n.º 7
0
def test_parse_editable_vcs_extras() -> None:
    assert parse_editable("svn+https://foo#egg=foo[extras]") == (
        "foo[extras]",
        "svn+https://foo#egg=foo[extras]",
        set(),
    )
Ejemplo n.º 8
0
def test_parse_editable_explicit_vcs() -> None:
    assert parse_editable("svn+https://foo#egg=foo") == (
        "foo",
        "svn+https://foo#egg=foo",
        set(),
    )
Ejemplo n.º 9
0
def test_parse_editable_vcs_extras():
    assert parse_editable('svn+https://foo#egg=foo[extras]') == (
        'foo[extras]',
        'svn+https://foo#egg=foo[extras]',
        None,
    )
Ejemplo n.º 10
0
def test_parse_editable_explicit_vcs():
    assert parse_editable('svn+https://foo#egg=foo') == (
        'foo',
        'svn+https://foo#egg=foo',
        None,
    )