diff options
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()) |