mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-02 19:32:47 +00:00
Allow version specifiers for pip install (#41792)
Allow version specifiers for pip install.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user