Merge "Add new test for the parse_all_validations_on_disk"

This commit is contained in:
Zuul 2021-02-03 12:59:31 +00:00 committed by Gerrit Code Review
commit e4eaf3fda1
1 changed files with 10 additions and 0 deletions

View File

@ -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")