mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 22:02:50 +00:00
PEP 8 W291 whitespace cleanup.
This commit is contained in:
@@ -54,7 +54,7 @@ class TestVMWareInventory(unittest.TestCase):
|
||||
vmw = VMWareInventory(load=False)
|
||||
vmw.args = fakeargs
|
||||
vmw.inventory = BASICINVENTORY
|
||||
showdata = vmw.show()
|
||||
showdata = vmw.show()
|
||||
serializable = False
|
||||
|
||||
try:
|
||||
@@ -71,7 +71,7 @@ class TestVMWareInventory(unittest.TestCase):
|
||||
vmw.args = fakeargs
|
||||
vmw.args.list = True
|
||||
vmw.inventory = BASICINVENTORY
|
||||
showdata = vmw.show()
|
||||
showdata = vmw.show()
|
||||
serializable = False
|
||||
|
||||
try:
|
||||
@@ -88,7 +88,7 @@ class TestVMWareInventory(unittest.TestCase):
|
||||
vmw.args = fakeargs
|
||||
vmw.args.list = True
|
||||
vmw.inventory = BASICINVENTORY
|
||||
showdata = vmw.show()
|
||||
showdata = vmw.show()
|
||||
expected = json.dumps(BASICINVENTORY, indent=2)
|
||||
assert showdata == expected
|
||||
|
||||
@@ -98,7 +98,7 @@ class TestVMWareInventory(unittest.TestCase):
|
||||
vmw.args = fakeargs
|
||||
vmw.args.host = 'foo'
|
||||
vmw.inventory = BASICINVENTORY
|
||||
showdata = vmw.show()
|
||||
showdata = vmw.show()
|
||||
serializable = False
|
||||
|
||||
try:
|
||||
@@ -116,7 +116,7 @@ class TestVMWareInventory(unittest.TestCase):
|
||||
vmw.args.list = False
|
||||
vmw.args.host = 'foo'
|
||||
vmw.inventory = BASICINVENTORY
|
||||
showdata = vmw.show()
|
||||
showdata = vmw.show()
|
||||
expected = BASICINVENTORY['_meta']['hostvars']['foo']
|
||||
expected = json.dumps(expected, indent=2)
|
||||
#import epdb; epdb.st()
|
||||
|
||||
@@ -260,7 +260,7 @@ class TestTaskExecutor(unittest.TestCase):
|
||||
# you can't use a list as a dict key so that would probably throw
|
||||
# an error later. If so, we can throw it now instead.
|
||||
# Squashing in this case would not be intuitive as the user is being
|
||||
# explicit in using each list entry as a key.
|
||||
# explicit in using each list entry as a key.
|
||||
job_vars = dict(pkg_mgr='yum', packages={ "a": "foo", "b": "bar", "foo": "baz", "bar": "quux" })
|
||||
items = [['a', 'b'], ['foo', 'bar']]
|
||||
mock_task.action = 'yum'
|
||||
|
||||
@@ -174,19 +174,19 @@ ID_LIKE="suse"
|
||||
},
|
||||
{
|
||||
"platform.dist": [
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
""
|
||||
],
|
||||
],
|
||||
"input": {
|
||||
"/etc/os-release": "NAME=\"openSUSE Tumbleweed\"\n# VERSION=\"20160917\"\nID=opensuse\nID_LIKE=\"suse\"\nVERSION_ID=\"20160917\"\nPRETTY_NAME=\"openSUSE Tumbleweed\"\nANSI_COLOR=\"0;32\"\nCPE_NAME=\"cpe:/o:opensuse:tumbleweed:20160917\"\nBUG_REPORT_URL=\"https://bugs.opensuse.org\"\nHOME_URL=\"https://www.opensuse.org/\"\n"
|
||||
},
|
||||
"name": "openSUSE Tumbleweed 20160917",
|
||||
},
|
||||
"name": "openSUSE Tumbleweed 20160917",
|
||||
"result": {
|
||||
"distribution_release": "NA",
|
||||
"distribution": "openSUSE Tumbleweed",
|
||||
"distribution_major_version": "NA",
|
||||
"os_family": "Suse",
|
||||
"distribution_release": "NA",
|
||||
"distribution": "openSUSE Tumbleweed",
|
||||
"distribution_major_version": "NA",
|
||||
"os_family": "Suse",
|
||||
"distribution_version": "20160917"
|
||||
}
|
||||
},
|
||||
|
||||
@@ -77,7 +77,7 @@ class TestPlay(unittest.TestCase):
|
||||
name="test play",
|
||||
hosts=['foo'],
|
||||
gather_facts=False,
|
||||
tasks=[dict(action='shell echo "hello world"')],
|
||||
tasks=[dict(action='shell echo "hello world"')],
|
||||
))
|
||||
|
||||
def test_play_with_handlers(self):
|
||||
|
||||
@@ -32,8 +32,8 @@ class TestCopyResultExclude(unittest.TestCase):
|
||||
def tearDown(self):
|
||||
pass
|
||||
|
||||
# The current behavior of the raw aciton in regards to executable is currently in question;
|
||||
# the test_raw_executable_is_not_empty_string verifies the current behavior (whether it is desireed or not.
|
||||
# The current behavior of the raw aciton in regards to executable is currently in question;
|
||||
# the test_raw_executable_is_not_empty_string verifies the current behavior (whether it is desireed or not.
|
||||
# Please refer to the following for context:
|
||||
# Issue: https://github.com/ansible/ansible/issues/16054
|
||||
# PR: https://github.com/ansible/ansible/pull/16085
|
||||
|
||||
@@ -32,7 +32,7 @@ safe_vars = {}
|
||||
for k,v in task_vars.items():
|
||||
if k not in ['vars', 'hostvars']:
|
||||
safe_vars[k] = copy.deepcopy(v)
|
||||
else:
|
||||
else:
|
||||
sdata = str(v)
|
||||
newv = eval(sdata)
|
||||
safe_vars[k] = newv
|
||||
@@ -46,7 +46,7 @@ with open('task_vars.json', 'wb') as f:
|
||||
|
||||
|
||||
class TaskMock(object):
|
||||
args = {'src': u'/tmp/deleteme',
|
||||
args = {'src': u'/tmp/deleteme',
|
||||
'dest': '/tmp/deleteme',
|
||||
'rsync_path': 'rsync'}
|
||||
async = None
|
||||
@@ -82,7 +82,7 @@ class ModuleLoaderMock(object):
|
||||
pass
|
||||
|
||||
class SharedLoaderMock(object):
|
||||
module_loader = ModuleLoaderMock()
|
||||
module_loader = ModuleLoaderMock()
|
||||
|
||||
class SynchronizeTester(object):
|
||||
|
||||
@@ -139,19 +139,19 @@ class SynchronizeTester(object):
|
||||
self.task.args[k] = v
|
||||
|
||||
# load inital task vars
|
||||
invarspath = os.path.join(fixturepath,
|
||||
invarspath = os.path.join(fixturepath,
|
||||
test_meta.get('fixtures', {}).get('taskvars_in', 'taskvars_in.json'))
|
||||
with open(invarspath, 'rb') as f:
|
||||
fdata = f.read()
|
||||
fdata = fdata.decode("utf-8")
|
||||
fdata = fdata.decode("utf-8")
|
||||
in_task_vars = json.loads(fdata)
|
||||
|
||||
# load expected final task vars
|
||||
outvarspath = os.path.join(fixturepath,
|
||||
outvarspath = os.path.join(fixturepath,
|
||||
test_meta.get('fixtures', {}).get('taskvars_out', 'taskvars_out.json'))
|
||||
with open(outvarspath, 'rb') as f:
|
||||
fdata = f.read()
|
||||
fdata = fdata.decode("utf-8")
|
||||
fdata = fdata.decode("utf-8")
|
||||
out_task_vars = json.loads(fdata)
|
||||
|
||||
# fixup the connection
|
||||
@@ -164,7 +164,7 @@ class SynchronizeTester(object):
|
||||
in_task_vars['hostvars'][k] = v
|
||||
|
||||
# initalize and run the module
|
||||
SAM = ActionModule(self.task, self.connection, self._play_context,
|
||||
SAM = ActionModule(self.task, self.connection, self._play_context,
|
||||
self.loader, self.templar, self.shared_loader_obj)
|
||||
SAM._execute_module = self._execute_module
|
||||
result = SAM.run(task_vars=in_task_vars)
|
||||
|
||||
@@ -311,7 +311,7 @@ class TestStrategyBase(unittest.TestCase):
|
||||
strategy_base._blocked_hosts = dict()
|
||||
|
||||
def _has_dead_workers():
|
||||
return False
|
||||
return False
|
||||
|
||||
strategy_base._tqm.has_dead_workers.side_effect = _has_dead_workers
|
||||
results = strategy_base._wait_on_pending_results(iterator=mock_iterator)
|
||||
|
||||
Reference in New Issue
Block a user