Skip to content

Commit

Permalink
TST: Add more cases for git url parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
HaoZeke committed Jul 1, 2024
1 parent 03106c4 commit e47ed5e
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions test/test_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -479,11 +479,25 @@ def mock_pip_caller(args):
'pkgname': None, 'specification': None,
'flags': [], 'is_editable': False, 'path': 'git+https://github.com/user/repo.git'
}),
# Git installations with a branch specified
("git+https://github.com/user/repo.git@branch", {
'pkgname': None, 'specification': None,
'flags': [], 'is_editable': False, 'path': 'git+https://github.com/user/repo.git@branch'
}),
# Editable git installations with #egg= suffix
("-e git+https://github.com/user/repo.git#egg=repo", {
'pkgname': 'repo', 'specification': None,
("-e git+https://github.com/user/repo.git#egg=pkgname", {
'pkgname': 'pkgname', 'specification': None,
'flags': ['-e'], 'is_editable': True, 'path': 'git+https://github.com/user/repo.git'
}),
# Git installations with a branch and egg specified
("git+https://github.com/user/pythonrepo.git@branch#egg=repo", {
'pkgname': 'repo', 'specification': None,
'flags': [], 'is_editable': False, 'path': 'git+https://github.com/user/pythonrepo.git@branch'
}),
# Flags with values
("--install-option=\"--prefix=/my/path\" numpy", {
'pkgname': 'numpy', 'specification': None,
Expand Down Expand Up @@ -513,6 +527,10 @@ def pip_caller(args):
("git+https://github.com/numpy/numpy.git#egg=numpy",
["install", "-v", "--upgrade", "git+https://github.com/numpy/numpy.git"]),
# Test with a git URL and branch
("git+https://github.com/numpy/numpy.git@branch",
["install", "-v", "--upgrade", "git+https://github.com/numpy/numpy.git@branch"]),
# Test with a local path
("./localpackage/", ["install", "-v", "--upgrade", "./localpackage/"]),
Expand Down

0 comments on commit e47ed5e

Please sign in to comment.