mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-05-02 15:21:25 -07:00
Allow version specifiers for pip install (#41792)
Allow version specifiers for pip install.
This commit is contained in:
parent
6d95624c22
commit
501503f4cb
4 changed files with 335 additions and 28 deletions
|
@ -22,3 +22,14 @@ def test_failure_when_pip_absent(mocker, capfd):
|
|||
results = json.loads(out)
|
||||
assert results['failed']
|
||||
assert 'pip needs to be installed' in results['msg']
|
||||
|
||||
|
||||
@pytest.mark.parametrize('patch_ansible_module, test_input, expected', [
|
||||
[None, ['django>1.11.1', '<1.11.2', 'ipaddress', 'simpleproject<2.0.0', '>1.1.0'],
|
||||
['django>1.11.1,<1.11.2', 'ipaddress', 'simpleproject<2.0.0,>1.1.0']],
|
||||
[None, ['django>1.11.1,<1.11.2,ipaddress', 'simpleproject<2.0.0,>1.1.0'],
|
||||
['django>1.11.1,<1.11.2', 'ipaddress', 'simpleproject<2.0.0,>1.1.0']],
|
||||
[None, ['django>1.11.1', '<1.11.2', 'ipaddress,simpleproject<2.0.0,>1.1.0'],
|
||||
['django>1.11.1,<1.11.2', 'ipaddress', 'simpleproject<2.0.0,>1.1.0']]])
|
||||
def test_recover_package_name(test_input, expected):
|
||||
assert pip._recover_package_name(test_input) == expected
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue