diff options
author | Martin Krizek <martin.krizek@gmail.com> | 2023-02-14 22:00:01 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-14 22:00:01 +0100 |
commit | bd329dc54329a126056723311abd7442ed6a0389 (patch) | |
tree | 15991b8c9b3c2071c366b5b1dc42c7a072c13b82 /test/units/playbook/test_helpers.py | |
parent | ansible-test - Disable the pep8 E203 rule (#79966) (diff) | |
download | ansible-bd329dc54329a126056723311abd7442ed6a0389.tar.xz ansible-bd329dc54329a126056723311abd7442ed6a0389.zip |
Make using blocks as handlers a parser error (#79993)
Fixes #79968
Diffstat (limited to '')
-rw-r--r-- | test/units/playbook/test_helpers.py | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/test/units/playbook/test_helpers.py b/test/units/playbook/test_helpers.py index 15e229cae5..03a9062849 100644 --- a/test/units/playbook/test_helpers.py +++ b/test/units/playbook/test_helpers.py @@ -152,20 +152,10 @@ class TestLoadListOfTasks(unittest.TestCase, MixinForMocks): self.assertIsInstance(block.always, list) self.assertEqual(len(block.always), 0) - def test_block_unknown_action_use_handlers(self): - ds = [{ - 'block': [{'action': 'foo_test_block_unknown_action'}] - }] - res = helpers.load_list_of_tasks(ds, play=self.mock_play, use_handlers=True, - variable_manager=self.mock_variable_manager, loader=self.fake_loader) - self._assert_is_task_list_or_blocks(res) - self.assertIsInstance(res[0], Block) - self._assert_default_block(res[0]) - - def test_one_bogus_block_use_handlers(self): + def test_block_use_handlers(self): ds = [{'block': True}] self.assertRaisesRegex(errors.AnsibleParserError, - "A malformed block was encountered", + "Using a block as a handler is not supported.", helpers.load_list_of_tasks, ds, play=self.mock_play, use_handlers=True, variable_manager=self.mock_variable_manager, loader=self.fake_loader) |