Refactors main() function and module manager in multiple modules in line with recent changes (#53984)

Adds variable types to docs
Refactors unit tests to remove deprecated parameters
This commit is contained in:
Wojciech Wypior 2019-03-19 07:30:58 +01:00 committed by Tim Rupp
parent ab238071e3
commit 9a007799d4
32 changed files with 627 additions and 465 deletions

View file

@ -152,10 +152,12 @@ class TestV1Manager(unittest.TestCase):
def test_ucs_explicit_present(self, *args):
set_module_args(dict(
ucs="/root/bigip.localhost.localdomain.ucs",
server='localhost',
password='password',
user='admin',
state='present'
state='present',
provider=dict(
server='localhost',
password='password',
user='admin'
)
))
module = AnsibleModule(
@ -178,10 +180,12 @@ class TestV1Manager(unittest.TestCase):
def test_ucs_installed(self, *args):
set_module_args(dict(
ucs="/root/bigip.localhost.localdomain.ucs",
server='localhost',
password='password',
user='admin',
state='installed'
state='installed',
provider=dict(
server='localhost',
password='password',
user='admin'
)
))
module = AnsibleModule(
@ -205,10 +209,12 @@ class TestV1Manager(unittest.TestCase):
def test_ucs_absent_exists(self, *args):
set_module_args(dict(
ucs="/root/bigip.localhost.localdomain.ucs",
server='localhost',
password='password',
user='admin',
state='absent'
state='absent',
provider=dict(
server='localhost',
password='password',
user='admin'
)
))
module = AnsibleModule(
@ -231,10 +237,12 @@ class TestV1Manager(unittest.TestCase):
def test_ucs_absent_fails(self, *args):
set_module_args(dict(
ucs="/root/bigip.localhost.localdomain.ucs",
server='localhost',
password='password',
user='admin',
state='absent'
state='absent',
provider=dict(
server='localhost',
password='password',
user='admin'
)
))
module = AnsibleModule(
@ -263,9 +271,11 @@ class TestV2Manager(unittest.TestCase):
def test_ucs_default_present(self, *args):
set_module_args(dict(
ucs="/root/bigip.localhost.localdomain.ucs",
server='localhost',
password='password',
user='admin'
provider=dict(
server='localhost',
password='password',
user='admin'
)
))
module = AnsibleModule(
@ -288,10 +298,12 @@ class TestV2Manager(unittest.TestCase):
def test_ucs_explicit_present(self, *args):
set_module_args(dict(
ucs="/root/bigip.localhost.localdomain.ucs",
server='localhost',
password='password',
user='admin',
state='present'
state='present',
provider=dict(
server='localhost',
password='password',
user='admin'
)
))
module = AnsibleModule(
@ -314,10 +326,12 @@ class TestV2Manager(unittest.TestCase):
def test_ucs_installed(self, *args):
set_module_args(dict(
ucs="/root/bigip.localhost.localdomain.ucs",
server='localhost',
password='password',
user='admin',
state='installed'
state='installed',
provider=dict(
server='localhost',
password='password',
user='admin'
)
))
module = AnsibleModule(
@ -341,10 +355,12 @@ class TestV2Manager(unittest.TestCase):
def test_ucs_absent_exists(self, *args):
set_module_args(dict(
ucs="/root/bigip.localhost.localdomain.ucs",
server='localhost',
password='password',
user='admin',
state='absent'
state='absent',
provider=dict(
server='localhost',
password='password',
user='admin'
)
))
module = AnsibleModule(
@ -367,10 +383,12 @@ class TestV2Manager(unittest.TestCase):
def test_ucs_absent_fails(self, *args):
set_module_args(dict(
ucs="/root/bigip.localhost.localdomain.ucs",
server='localhost',
password='password',
user='admin',
state='absent'
state='absent',
provider=dict(
server='localhost',
password='password',
user='admin'
)
))
module = AnsibleModule(