mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-28 13:57:43 +00:00
Merge remote-tracking branch 'origin/main' into fix/security/swarm-ingress-guard/1089
This commit is contained in:
23 files changed
+79
-315
No files matched your search
@@ -1,5 +1,7 @@
|
||||
import importlib.util
|
||||
import tempfile
|
||||
import unittest
|
||||
from pathlib import Path
|
||||
from unittest.mock import patch
|
||||
|
||||
from ansible.errors import AnsibleError
|
||||
@@ -168,6 +170,16 @@ class TestComposeFArgs(unittest.TestCase):
|
||||
|
||||
self.assertEqual(out, "-f /x/compose.yml")
|
||||
|
||||
def test_role_provides_override_reads_the_role_of_the_given_application(self):
|
||||
with (
|
||||
tempfile.TemporaryDirectory() as role,
|
||||
patch.object(self.m, "abs_role_path_by_application_id", return_value=role),
|
||||
):
|
||||
self.assertFalse(self.m._role_provides_override(application_id="x"))
|
||||
(Path(role) / "templates").mkdir()
|
||||
(Path(role) / "templates" / "compose.override.yml.j2").write_text("")
|
||||
self.assertTrue(self.m._role_provides_override(application_id="x"))
|
||||
|
||||
def test_requires_one_term(self):
|
||||
with self.assertRaises(AnsibleError):
|
||||
self.lookup.run([], variables=self.vars)
|
||||
|
||||
Reference in new issue
Block a user