From 5c8eab981cdb33a7cd4d8bc84ca48ecc313cb33f Mon Sep 17 00:00:00 2001 From: Petru Conduraru Date: Sun, 12 Jul 2026 22:52:32 +0300 Subject: [PATCH] Fix ci-bonsai-daily: get_dictionaries no longer clobbers injected client Bsdd.get_dictionaries() unconditionally did cls.client = bsdd.Client(), replacing whatever client was already set - including the bSDDClientStub the BDD suite injects at module load (test_feature.py: tool.Bsdd.client = bSDDClientStub()) to avoid live network calls. Because "Load bSDD Dictionaries" is the first step of every bsdd.feature scenario, the stub was discarded before its fixture data ("LCA", "BonsaiTestDict") could ever be returned. The re-init is unnecessary: bsdd.Client.__init__ only sets baseurl and blank tokens, and the next line already updates baseurl defensively via hasattr. Drop the clobbering assignment; reuse whichever client is already set. Verified in headless Blender: bsdd scenarios (load dictionaries, search all/single dictionary) go from 3 failed ("Could not see LCA/ BonsaiTestDict") to 3 passed. This change was made with the assistance of an AI tool. Co-Authored-By: Claude Fable 5 --- src/bonsai/bonsai/tool/bsdd.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/bonsai/bonsai/tool/bsdd.py b/src/bonsai/bonsai/tool/bsdd.py index 387474b81f..72aba9d7b2 100644 --- a/src/bonsai/bonsai/tool/bsdd.py +++ b/src/bonsai/bonsai/tool/bsdd.py @@ -138,7 +138,6 @@ class Bsdd(bonsai.core.tool.Bsdd): def get_dictionaries(cls) -> list[bsdd.DictionaryContractV1]: prefs = tool.Blender.get_addon_preferences() baseurl = getattr(prefs, "bsdd_baseurl", "https://api.bsdd.buildingsmart.org/api/") - cls.client = bsdd.Client() if hasattr(cls.client, "baseurl"): cls.client.baseurl = baseurl response = cls.client.get_dictionary(include_test_dictionaries=prefs.bsdd_load_test_dictionaries)