diff options
| author | Christophe Besson <cbesson@gmail.com> | 2026-09-25 01:17:32 +0200 |
|---|---|---|
| committer | Christophe Besson <cbesson@gmail.com> | 2026-09-25 01:17:32 +0200 |
| commit | 320620a18399eb43c4d9056e9fe4c3ffac8fcfd4 (patch) | |
| tree | a7eb9f0c0c3428fcb20a245d2a5b2b828a8a1a8e /packages/meshbay-node/tests/node_source.py | |
| parent | 387138410532daad174ed602fd03f4f979cd3d81 (diff) | |
| download | meshbay-320620a18399eb43c4d9056e9fe4c3ffac8fcfd4.tar.gz | |
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 <noreply@anthropic.com>
Diffstat (limited to 'packages/meshbay-node/tests/node_source.py')
| -rw-r--r-- | packages/meshbay-node/tests/node_source.py | 17 |
1 files changed, 17 insertions, 0 deletions
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()) |