test/: PEP8 compliancy (#24803)

* test/: PEP8 compliancy

- Make PEP8 compliant

* Python3 chokes on casting int to bytes (#24952)

But if we tell the formatter that the var is a number, it works
This commit is contained in:
Dag Wieers 2017-05-30 19:05:19 +02:00 committed by John R Barker
parent 31c59ad5f9
commit 4efec414e7
110 changed files with 1702 additions and 1547 deletions

View file

@ -57,10 +57,9 @@ class TestPlayIterator(unittest.TestCase):
new_hs = hs.copy()
@patch('ansible.playbook.role.definition.unfrackpath', mock_unfrackpath_noop)
def test_play_iterator(self):
#import epdb; epdb.st()
# import epdb; epdb.st()
fake_loader = DictDataLoader({
"test_play.yml": """
- hosts: all
@ -191,11 +190,11 @@ class TestPlayIterator(unittest.TestCase):
self.assertEqual(task.name, "role always task")
self.assertIsNotNone(task._role)
# role include task
#(host_state, task) = itr.get_next_task_for_host(hosts[0])
#self.assertIsNotNone(task)
#self.assertEqual(task.action, 'debug')
#self.assertEqual(task.name, "role included task")
#self.assertIsNotNone(task._role)
# (host_state, task) = itr.get_next_task_for_host(hosts[0])
# self.assertIsNotNone(task)
# self.assertEqual(task.action, 'debug')
# self.assertEqual(task.name, "role included task")
# self.assertIsNotNone(task._role)
# role task after include
(host_state, task) = itr.get_next_task_for_host(hosts[0])
self.assertIsNotNone(task)
@ -427,7 +426,7 @@ class TestPlayIterator(unittest.TestCase):
)
# test the high-level add_tasks() method
s = HostState(blocks=[0,1,2])
s = HostState(blocks=[0, 1, 2])
itr._insert_tasks_into_state = MagicMock(return_value=s)
itr.add_tasks(hosts[0], [MagicMock(), MagicMock(), MagicMock()])
self.assertEqual(itr._host_states[hosts[0].name], s)