def test_parse_editable_local(isdir_mock, exists_mock, getcwd_mock, normcase_mock): exists_mock.return_value = isdir_mock.return_value = True # mocks needed to support path operations on windows tests normcase_mock.return_value = getcwd_mock.return_value = "/some/path" assert parse_editable(".", "git") == (None, "file:///some/path", None) normcase_mock.return_value = "/some/path/foo" assert parse_editable("foo", "git") == (None, "file:///some/path/foo", None)
def test_parse_editable_local(isdir_mock, exists_mock, getcwd_mock, normcase_mock): exists_mock.return_value = isdir_mock.return_value = True # mocks needed to support path operations on windows tests normcase_mock.return_value = getcwd_mock.return_value = "/some/path" assert parse_editable('.', 'git') == (None, 'file:///some/path', None) normcase_mock.return_value = "/some/path/foo" assert parse_editable('foo', 'git') == (None, 'file:///some/path/foo', None)
def test_parse_editable_local_extras(isdir_mock, exists_mock, getcwd_mock, normcase_mock): exists_mock.return_value = isdir_mock.return_value = True normcase_mock.return_value = getcwd_mock.return_value = "/some/path" assert_equal(parse_editable('.[extras]', 'git'), (None, 'file://' + "/some/path", ('extras', ))) normcase_mock.return_value = "/some/path/foo" assert_equal(parse_editable('foo[bar,baz]', 'git'), (None, 'file:///some/path/foo', ('bar', 'baz')))
def test_parse_editable_local_extras(isdir_mock, exists_mock, getcwd_mock, normcase_mock): exists_mock.return_value = isdir_mock.return_value = True normcase_mock.return_value = getcwd_mock.return_value = "/some/path" assert_equal( parse_editable('.[extras]', 'git'), (None, 'file://' + "/some/path", ('extras',)) ) normcase_mock.return_value = "/some/path/foo" assert_equal( parse_editable('foo[bar,baz]', 'git'), (None, 'file:///some/path/foo', ('bar', 'baz')) )
def test_parse_editable_local(isdir_mock, exists_mock, getcwd_mock, normcase_mock): exists_mock.return_value = isdir_mock.return_value = True # mocks needed to support path operations on windows tests normcase_mock.return_value = getcwd_mock.return_value = "/some/path" assert_equal( parse_editable('.', 'git'), (None, 'file:///some/path', None) ) normcase_mock.return_value = "/some/path/foo" assert_equal( parse_editable('foo', 'git'), (None, 'file:///some/path/foo', None) )
def test_parse_editable_vcs_extras(): assert_equal( parse_editable('svn+https://foo#egg=foo[extras]', 'git'), ('foo[extras]', 'svn+https://foo#egg=foo[extras]', None) )
def test_parse_editable_explicit_vcs(): assert_equal( parse_editable('svn+https://foo#egg=foo', 'git'), ('foo', 'svn+https://foo#egg=foo', None) )
def test_parse_editable_default_vcs(): assert_equal( parse_editable('https://foo#egg=foo', 'git'), ('foo', 'git+https://foo#egg=foo', None) )
def test_parse_editable_local_extras(isdir_mock, exists_mock, getcwd_mock, normcase_mock): exists_mock.return_value = isdir_mock.return_value = True normcase_mock.return_value = getcwd_mock.return_value = "/some/path" assert parse_editable(".[extras]", "git") == (None, "file://" + "/some/path", ("extras",)) normcase_mock.return_value = "/some/path/foo" assert parse_editable("foo[bar,baz]", "git") == (None, "file:///some/path/foo", ("bar", "baz"))
def test_parse_editable_vcs_extras(): assert parse_editable("svn+https://foo#egg=foo[extras]", "git") == ( "foo[extras]", "svn+https://foo#egg=foo[extras]", {"egg": "foo[extras]"}, )
def test_parse_editable_explicit_vcs(): assert parse_editable("svn+https://foo#egg=foo", "git") == ("foo", "svn+https://foo#egg=foo", {"egg": "foo"})
def test_parse_editable_default_vcs(): assert parse_editable("https://foo#egg=foo", "git") == ("foo", "git+https://foo#egg=foo", {"egg": "foo"})
def test_parse_editable_vcs_extras(): assert parse_editable('svn+https://foo#egg=foo[extras]', 'git') == ('foo[extras]', 'svn+https://foo#egg=foo[extras]', { 'egg': 'foo[extras]' })
def test_parse_editable_explicit_vcs(): assert parse_editable('svn+https://foo#egg=foo', 'git') == ('foo', 'svn+https://foo#egg=foo', { 'egg': 'foo' })
def test_parse_editable_default_vcs(): assert parse_editable('https://foo#egg=foo', 'git') == ('foo', 'git+https://foo#egg=foo', { 'egg': 'foo' })