summaryrefslogtreecommitdiffstats
path: root/packages/meshbay-node/tests/conftest.py
diff options
context:
space:
mode:
Diffstat (limited to 'packages/meshbay-node/tests/conftest.py')
-rw-r--r--packages/meshbay-node/tests/conftest.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/packages/meshbay-node/tests/conftest.py b/packages/meshbay-node/tests/conftest.py
new file mode 100644
index 0000000..03dfb42
--- /dev/null
+++ b/packages/meshbay-node/tests/conftest.py
@@ -0,0 +1,18 @@
+"""Shared fixtures and helpers for node tests."""
+
+from pathlib import Path
+
+from meshbay_node.roots import RootSet
+
+
+def one_root(path: Path, *, name: str = "", kind: str = "generic") -> RootSet:
+ """
+ A RootSet with a single root over `path`, receiving uploads.
+
+ The equivalent of the old `shared_dir`. Note what it implies for assertions:
+ a file directly in `path` now has `entry.path == <basename of path>`, not
+ `""` — every index path carries its root name, in a group with one root as
+ much as in a group with five.
+ """
+ return RootSet.build([{"path": str(path), "name": name, "kind": kind,
+ "upload": True}])