merge: testing → main (reconcile 2-week divergence)
This commit is contained in:
@@ -18,13 +18,35 @@ _FUZZ_SETTINGS = dict(
|
||||
)
|
||||
|
||||
|
||||
def make_fake_decnet_logging() -> ModuleType:
|
||||
mod = ModuleType("decnet_logging")
|
||||
def make_fake_syslog_bridge() -> ModuleType:
|
||||
mod = ModuleType("syslog_bridge")
|
||||
mod.syslog_line = MagicMock(return_value="")
|
||||
mod.write_syslog_file = MagicMock()
|
||||
mod.forward_syslog = MagicMock()
|
||||
mod.SEVERITY_WARNING = 4
|
||||
mod.SEVERITY_INFO = 6
|
||||
# encode_secret returns the universal cred SD shape; tests don't
|
||||
# care about the exact bytes, just that the key set is correct.
|
||||
mod.encode_secret = MagicMock(
|
||||
return_value={"secret_printable": "", "secret_b64": ""}
|
||||
)
|
||||
# classify_authorization returns None for unknown / absent auth so
|
||||
# services that call **(cred or {}) get a no-op spread.
|
||||
mod.classify_authorization = MagicMock(return_value=None)
|
||||
return mod
|
||||
|
||||
|
||||
def load_real_instance_seed() -> ModuleType:
|
||||
"""Load the real instance_seed helper so templates under test see the
|
||||
actual per-instance seeding behavior, not a stub. Tests that need
|
||||
determinism should pin NODE_NAME via monkeypatch before loading a
|
||||
template."""
|
||||
import importlib.util
|
||||
spec = importlib.util.spec_from_file_location(
|
||||
"instance_seed", "decnet/templates/instance_seed.py"
|
||||
)
|
||||
mod = importlib.util.module_from_spec(spec)
|
||||
spec.loader.exec_module(mod)
|
||||
return mod
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user