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, )
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", set(['extras']), ) abspath_mock.return_value = "/some/path/foo" assert parse_editable('foo[bar,baz]') == ( None, 'file:///some/path/foo', set(['bar', 'baz']), )
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'}, )
def test_parse_editable_vcs_extras(): assert parse_editable('svn+https://foo#egg=foo[extras]') == ( 'foo[extras]', 'svn+https://foo#egg=foo[extras]', None, )
def test_parse_editable_explicit_vcs(): assert parse_editable('svn+https://foo#egg=foo') == ( 'foo', 'svn+https://foo#egg=foo', None, )