mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-07-19 23:04:25 +02:00
23 lines
755 B
Python
23 lines
755 B
Python
import os
|
|
import unittest
|
|
|
|
ROLES_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), '../../roles'))
|
|
|
|
class TestRolesHaveMetaMain(unittest.TestCase):
|
|
def test_each_role_has_meta_main(self):
|
|
missing_meta = []
|
|
for role in os.listdir(ROLES_DIR):
|
|
role_path = os.path.join(ROLES_DIR, role)
|
|
if os.path.isdir(role_path):
|
|
meta_main = os.path.join(role_path, 'meta', 'main.yml')
|
|
if not os.path.isfile(meta_main):
|
|
missing_meta.append(role)
|
|
if missing_meta:
|
|
self.fail(
|
|
"The following roles are missing meta/main.yml:\n" +
|
|
"\n".join(missing_meta)
|
|
)
|
|
|
|
if __name__ == '__main__':
|
|
unittest.main()
|