Browse Source

Add new test for the parse_all_validations_on_disk

Add a new test to raise exeception if you have no groups in your playbook.

Co-authored-by: Daniel Bengtsson <dbengt@redhat.com>
Change-Id: I984304ec22511709370e36f4b4fb6a43100b043c
changes/57/773157/3
Owen McGonagle 1 year ago
parent
commit
aa54ac2c6f
  1. 10
      validations_libs/tests/test_utils.py

10
validations_libs/tests/test_utils.py

@ -223,3 +223,13 @@ class TestUtils(TestCase):
self.assertRaises(TypeError,
utils.convert_data,
data=data_dict)
@mock.patch('yaml.safe_load', return_value=fakes.FAKE_PLAYBOOK3)
@mock.patch('six.moves.builtins.open')
@mock.patch('glob.glob')
def test_playbook_without_groups(self, mock_glob, mock_open, mock_load):
mock_glob.return_value = \
['/foo/playbook/foo.yaml']
self.assertRaises(RuntimeError,
utils.parse_all_validations_on_disk,
"/foo/playbook")

Loading…
Cancel
Save