mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-02-04 07:51:50 +00:00
Stop re-defining the argument spec in unit tests (#11235)
* Stop re-defining the argument spec in unit tests. * Shut up linter.
This commit is contained in:
parent
6365b5a981
commit
fb2f34ba85
6 changed files with 35 additions and 274 deletions
|
|
@ -589,7 +589,7 @@ def get_archive(module):
|
|||
return TarArchive(module)
|
||||
|
||||
|
||||
def main():
|
||||
def create_module() -> AnsibleModule:
|
||||
module = AnsibleModule(
|
||||
argument_spec=dict(
|
||||
path=dict(type="list", elements="path", required=True),
|
||||
|
|
@ -603,6 +603,11 @@ def main():
|
|||
add_file_common_args=True,
|
||||
supports_check_mode=True,
|
||||
)
|
||||
return module
|
||||
|
||||
|
||||
def main():
|
||||
module = create_module()
|
||||
|
||||
check_mode = module.check_mode
|
||||
|
||||
|
|
|
|||
|
|
@ -510,7 +510,7 @@ def create_file(content):
|
|||
return tmpfile
|
||||
|
||||
|
||||
def main():
|
||||
def create_module() -> AnsibleModule:
|
||||
choose_between = (["certificate", "certificate_path"], ["private_key", "private_key_path"])
|
||||
|
||||
module = AnsibleModule(
|
||||
|
|
@ -533,6 +533,11 @@ def main():
|
|||
add_file_common_args=True,
|
||||
)
|
||||
module.run_command_environ_update = dict(LANG="C", LC_ALL="C", LC_MESSAGES="C")
|
||||
return module
|
||||
|
||||
|
||||
def main():
|
||||
module = create_module()
|
||||
|
||||
result = dict()
|
||||
jks = JavaKeystore(module)
|
||||
|
|
|
|||
|
|
@ -2675,8 +2675,7 @@ class Nmcli:
|
|||
return self._compare_conn_params(self.show_connection(), options)
|
||||
|
||||
|
||||
def main():
|
||||
# Parsing argument file
|
||||
def create_module() -> AnsibleModule:
|
||||
module = AnsibleModule(
|
||||
argument_spec=dict(
|
||||
ignore_unsupported_suboptions=dict(type="bool", default=False),
|
||||
|
|
@ -2870,6 +2869,12 @@ def main():
|
|||
supports_check_mode=True,
|
||||
)
|
||||
module.run_command_environ_update = dict(LANG="C", LC_ALL="C", LC_MESSAGES="C", LC_CTYPE="C")
|
||||
return module
|
||||
|
||||
|
||||
def main():
|
||||
# Parsing argument file
|
||||
module = create_module()
|
||||
|
||||
nmcli = Nmcli(module)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue