ModelTranslator: fix QR engine docstring, add glob discovery test

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
ud18010
2026-07-22 16:44:47 +08:00
co-authored by Claude Opus 4.8
parent 55654e8d33
commit e7dcf71d35
2 changed files with 15 additions and 1 deletions
@@ -83,6 +83,20 @@ class TestFindQrEngine(unittest.TestCase):
os.environ["APPDATA"] = tempfile.mkdtemp()
self.assertIsNone(qb.find_qr_engine())
def test_globs_addon_path_picks_last(self):
root = tempfile.mkdtemp()
os.environ.pop("QR_ENGINE", None)
os.environ["APPDATA"] = root
base = os.path.join(root, "Blender Foundation", "Blender")
for ver in ("4.2", "5.0"):
eng_dir = os.path.join(base, ver, "scripts", "addons",
"QuadRemesher", "Engine")
os.makedirs(eng_dir)
open(os.path.join(eng_dir, "xremesh.exe"), "w").close()
chosen = qb.find_qr_engine()
self.assertIsNotNone(chosen)
self.assertIn(os.path.join("5.0", "scripts"), chosen)
if __name__ == "__main__":
unittest.main()