From 320620a18399eb43c4d9056e9fe4c3ffac8fcfd4 Mon Sep 17 00:00:00 2001 From: Christophe Besson Date: Fri, 25 Sep 2026 01:17:32 +0200 Subject: test(node): read ops wherever it is split The tests that read ops.py for an absence (fastapi, a TOML path without as_posix, the reference app's name) and the one counting operations by module now take every file of ops.py or the ops package. Co-Authored-By: Claude Opus 5.5 --- packages/meshbay-node/tests/node_source.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'packages/meshbay-node/tests/node_source.py') diff --git a/packages/meshbay-node/tests/node_source.py b/packages/meshbay-node/tests/node_source.py index 918cf05..46d62ac 100644 --- a/packages/meshbay-node/tests/node_source.py +++ b/packages/meshbay-node/tests/node_source.py @@ -109,3 +109,20 @@ def daemon_call(name: str) -> str: found.append(ast.get_source_segment(text, node)) assert len(found) == 1, f"{len(found)} calls to {name} in the daemon — re-read this test" return found[0] + + +# `ops.py`, or the package it becomes: every file of it either way. +OPS_PACKAGE = SRC / "ops" + + +def ops_files() -> list[Path]: + """Every module of the operations layer, however it is split up.""" + files = [SRC / "ops.py"] if (SRC / "ops.py").exists() else [] + if OPS_PACKAGE.is_dir(): + files += sorted(p for p in OPS_PACKAGE.rglob("*.py") + if "__pycache__" not in p.parts) + return files + + +def ops_source() -> str: + return "\n".join(p.read_text(encoding="utf-8") for p in ops_files()) -- cgit v1.2.3