mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 21:00:22 -07:00
* Mark 'name' parameter as required. Closes https://github.com/ansible/ansible/issues/29785. * Add the `linode-python` dependency for unit tests. * Add unit test for linode name parameter. * Add note about where to find required arguments. Closes https://github.com/ansible/ansible/issues/44696.
This commit is contained in:
parent
30fd326953
commit
fbcdf8ba5b
5 changed files with 35 additions and 2 deletions
|
@ -30,4 +30,7 @@ pyfmg
|
|||
xmljson
|
||||
|
||||
# requirement for winrm connection plugin tests
|
||||
pexpect
|
||||
pexpect
|
||||
|
||||
# requirement for the linode module
|
||||
linode-python
|
||||
|
|
0
test/units/modules/cloud/linode/__init__.py
Normal file
0
test/units/modules/cloud/linode/__init__.py
Normal file
13
test/units/modules/cloud/linode/conftest.py
Normal file
13
test/units/modules/cloud/linode/conftest.py
Normal file
|
@ -0,0 +1,13 @@
|
|||
import pytest
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def api_key(monkeypatch):
|
||||
monkeypatch.setenv('LINODE_API_KEY', 'foobar')
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def auth(monkeypatch):
|
||||
def patched_test_echo(dummy):
|
||||
return []
|
||||
monkeypatch.setattr('linode.api.Api.test_echo', patched_test_echo)
|
15
test/units/modules/cloud/linode/test_linode.py
Normal file
15
test/units/modules/cloud/linode/test_linode.py
Normal file
|
@ -0,0 +1,15 @@
|
|||
from __future__ import (absolute_import, division, print_function)
|
||||
|
||||
import pytest
|
||||
|
||||
from ansible.modules.cloud.linode import linode
|
||||
from units.modules.utils import set_module_args
|
||||
|
||||
if not linode.HAS_LINODE:
|
||||
pytestmark = pytest.mark.skip('test_linode.py requires the `linode-python` module')
|
||||
|
||||
|
||||
def test_name_is_a_required_parameter(api_key, auth):
|
||||
with pytest.raises(SystemExit):
|
||||
set_module_args({})
|
||||
linode.main()
|
Loading…
Add table
Add a link
Reference in a new issue