Solved last open tests

This commit is contained in:
2025-07-10 23:19:44 +02:00
parent 3141166fb5
commit 1f4dee49bc
2 changed files with 18 additions and 12 deletions

View File

@@ -6,7 +6,7 @@ import unittest
import yaml
# Adjust this import to match the real path in your project
from cli.ensure.vars_main_files import run, ROLES_DIR
from cli.fix.vars_main_files import run, ROLES_DIR
class TestEnsureVarsMain(unittest.TestCase):
def setUp(self):
@@ -17,11 +17,11 @@ class TestEnsureVarsMain(unittest.TestCase):
# Monkey-patch the module's ROLES_DIR to point here
self._orig_roles_dir = ROLES_DIR
setattr(__import__("cli.ensure.vars_main_files", fromlist=["ROLES_DIR"]), "ROLES_DIR", self.roles_dir)
setattr(__import__("cli.fix.vars_main_files", fromlist=["ROLES_DIR"]), "ROLES_DIR", self.roles_dir)
def tearDown(self):
# restore and cleanup
setattr(__import__("cli.ensure.vars_main_files", fromlist=["ROLES_DIR"]), "ROLES_DIR", self._orig_roles_dir)
setattr(__import__("cli.fix.vars_main_files", fromlist=["ROLES_DIR"]), "ROLES_DIR", self._orig_roles_dir)
shutil.rmtree(self.tmpdir)
def _make_role(self, name, vars_content=None):