mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-07-03 00:58:53 +00:00
Refactors main() function and module manager in multiple modules in line with recent changes (#53974)
Adds variable types to docs Refactors unit tests to remove deprecated parameters
This commit is contained in:
parent
313e07dfd3
commit
284565c39e
26 changed files with 412 additions and 239 deletions
|
|
@ -93,9 +93,11 @@ class TestManager(unittest.TestCase):
|
|||
name='foo',
|
||||
route_domain=20,
|
||||
partition='Common',
|
||||
server='localhost',
|
||||
password='password',
|
||||
user='admin'
|
||||
provider=dict(
|
||||
server='localhost',
|
||||
password='password',
|
||||
user='admin'
|
||||
)
|
||||
))
|
||||
|
||||
module = AnsibleModule(
|
||||
|
|
|
|||
|
|
@ -106,9 +106,11 @@ class TestManager(unittest.TestCase):
|
|||
route_domain=20,
|
||||
tsig_key='key1',
|
||||
partition='Common',
|
||||
server='localhost',
|
||||
password='password',
|
||||
user='admin'
|
||||
provider=dict(
|
||||
server='localhost',
|
||||
password='password',
|
||||
user='admin'
|
||||
)
|
||||
))
|
||||
|
||||
module = AnsibleModule(
|
||||
|
|
|
|||
|
|
@ -104,9 +104,11 @@ class TestManager(unittest.TestCase):
|
|||
# Configure the arguments that would be sent to the Ansible module
|
||||
set_module_args(dict(
|
||||
name='foo',
|
||||
password='password',
|
||||
server='localhost',
|
||||
user='admin'
|
||||
provider=dict(
|
||||
server='localhost',
|
||||
password='password',
|
||||
user='admin'
|
||||
)
|
||||
))
|
||||
|
||||
module = AnsibleModule(
|
||||
|
|
|
|||
|
|
@ -108,9 +108,11 @@ class TestManager(unittest.TestCase):
|
|||
# Configure the arguments that would be sent to the Ansible module
|
||||
set_module_args(dict(
|
||||
name='foo',
|
||||
password='password',
|
||||
server='localhost',
|
||||
user='admin'
|
||||
provider=dict(
|
||||
server='localhost',
|
||||
password='password',
|
||||
user='admin'
|
||||
)
|
||||
))
|
||||
|
||||
module = AnsibleModule(
|
||||
|
|
|
|||
|
|
@ -95,14 +95,17 @@ class TestManager(unittest.TestCase):
|
|||
set_module_args(dict(
|
||||
name='foo',
|
||||
source='file.txt',
|
||||
password='password',
|
||||
server='localhost',
|
||||
user='admin'
|
||||
provider=dict(
|
||||
server='localhost',
|
||||
password='password',
|
||||
user='admin'
|
||||
)
|
||||
))
|
||||
|
||||
module = AnsibleModule(
|
||||
argument_spec=self.spec.argument_spec,
|
||||
supports_check_mode=self.spec.supports_check_mode
|
||||
supports_check_mode=self.spec.supports_check_mode,
|
||||
required_if=self.spec.required_if
|
||||
)
|
||||
|
||||
tm = IFileManager(module=module)
|
||||
|
|
|
|||
|
|
@ -113,9 +113,11 @@ class TestManager(unittest.TestCase):
|
|||
dict(country='EU')
|
||||
],
|
||||
fqdns=['google.com', 'mit.edu'],
|
||||
password='password',
|
||||
server='localhost',
|
||||
user='admin'
|
||||
provider=dict(
|
||||
server='localhost',
|
||||
password='password',
|
||||
user='admin'
|
||||
)
|
||||
))
|
||||
|
||||
module = AnsibleModule(
|
||||
|
|
|
|||
|
|
@ -91,9 +91,11 @@ class TestManager(unittest.TestCase):
|
|||
description='this is a description',
|
||||
threshold_sensitivity='low',
|
||||
default_whitelist='whitelist1',
|
||||
password='password',
|
||||
server='localhost',
|
||||
user='admin'
|
||||
provider=dict(
|
||||
server='localhost',
|
||||
password='password',
|
||||
user='admin'
|
||||
)
|
||||
))
|
||||
|
||||
module = AnsibleModule(
|
||||
|
|
|
|||
|
|
@ -88,9 +88,11 @@ class TestManager(unittest.TestCase):
|
|||
name='aaaa',
|
||||
state='mitigate',
|
||||
profile='foo',
|
||||
password='password',
|
||||
server='localhost',
|
||||
user='admin'
|
||||
provider=dict(
|
||||
server='localhost',
|
||||
password='password',
|
||||
user='admin'
|
||||
)
|
||||
))
|
||||
|
||||
module = AnsibleModule(
|
||||
|
|
|
|||
|
|
@ -93,9 +93,11 @@ class TestUntypedManager(unittest.TestCase):
|
|||
enforced_policy='enforced1',
|
||||
staged_policy='staged1',
|
||||
service_policy='service1',
|
||||
password='password',
|
||||
server='localhost',
|
||||
user='admin'
|
||||
provider=dict(
|
||||
server='localhost',
|
||||
password='password',
|
||||
user='admin'
|
||||
)
|
||||
))
|
||||
|
||||
module = AnsibleModule(
|
||||
|
|
|
|||
|
|
@ -96,9 +96,11 @@ class TestManager(unittest.TestCase):
|
|||
name='foo',
|
||||
description='this is a description',
|
||||
rules=['rule1', 'rule2', 'rule3'],
|
||||
password='password',
|
||||
server='localhost',
|
||||
user='admin'
|
||||
provider=dict(
|
||||
server='localhost',
|
||||
password='password',
|
||||
user='admin'
|
||||
)
|
||||
))
|
||||
|
||||
module = AnsibleModule(
|
||||
|
|
|
|||
|
|
@ -117,9 +117,11 @@ class TestManager(unittest.TestCase):
|
|||
ports=[1, 2, 3, 4],
|
||||
port_ranges=['10-20', '30-40', '50-60'],
|
||||
port_lists=['/Common/foo', 'foo'],
|
||||
password='password',
|
||||
server='localhost',
|
||||
user='admin'
|
||||
provider=dict(
|
||||
server='localhost',
|
||||
password='password',
|
||||
user='admin'
|
||||
)
|
||||
))
|
||||
|
||||
module = AnsibleModule(
|
||||
|
|
|
|||
|
|
@ -136,11 +136,18 @@ class TestManager(unittest.TestCase):
|
|||
irule='irule1',
|
||||
action='accept',
|
||||
logging='yes',
|
||||
provider=dict(
|
||||
server='localhost',
|
||||
password='password',
|
||||
user='admin'
|
||||
)
|
||||
))
|
||||
|
||||
module = AnsibleModule(
|
||||
argument_spec=self.spec.argument_spec,
|
||||
supports_check_mode=self.spec.supports_check_mode
|
||||
supports_check_mode=self.spec.supports_check_mode,
|
||||
mutually_exclusive=self.spec.mutually_exclusive,
|
||||
required_one_of=self.spec.required_one_of
|
||||
)
|
||||
|
||||
# Override methods in the specific type of manager
|
||||
|
|
|
|||
|
|
@ -88,9 +88,11 @@ class TestManager(unittest.TestCase):
|
|||
name='foo',
|
||||
description='this is a description',
|
||||
rules=['rule1', 'rule2', 'rule3'],
|
||||
password='password',
|
||||
server='localhost',
|
||||
user='admin'
|
||||
provider=dict(
|
||||
server='localhost',
|
||||
password='password',
|
||||
user='admin'
|
||||
)
|
||||
))
|
||||
|
||||
module = AnsibleModule(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue