Add durable portable graph publication
This commit is contained in:
parent
96e3965855
commit
1134c2d375
19 changed files with 2542 additions and 13 deletions
|
|
@ -17,6 +17,25 @@ from docforge.viewer_manager import ViewerManager
|
|||
ROOT = Path(__file__).resolve().parents[1]
|
||||
FIXTURES = ROOT / "tests" / "fixtures"
|
||||
|
||||
GRAPH_CONFIG = """
|
||||
|
||||
[graph_render]
|
||||
output_root = ".docforge/portable-graph"
|
||||
|
||||
[[graph_render.views]]
|
||||
id = "architecture"
|
||||
renderer = "portable_graph_html"
|
||||
output = "architecture.html"
|
||||
title = "Alpha architecture"
|
||||
root = "guide.workflow"
|
||||
initial_mode = "nodes"
|
||||
depth = 2
|
||||
max_nodes = 20
|
||||
max_edges = 40
|
||||
max_work = 1000
|
||||
include_logic = false
|
||||
"""
|
||||
|
||||
|
||||
class DocForgeCliTests(unittest.TestCase):
|
||||
def copy_fixture(self, destination: Path) -> Path:
|
||||
|
|
@ -134,6 +153,30 @@ class DocForgeCliTests(unittest.TestCase):
|
|||
else:
|
||||
os.environ["DOCFORGE_VIEWER_MANAGER_STATE"] = previous
|
||||
|
||||
def test_portable_graph_plan_render_and_status_are_self_service(self) -> None:
|
||||
with tempfile.TemporaryDirectory() as directory:
|
||||
root = self.copy_fixture(Path(directory))
|
||||
descriptor = root / ".docforge/project.toml"
|
||||
descriptor.write_text(
|
||||
descriptor.read_text(encoding="utf-8") + GRAPH_CONFIG,
|
||||
encoding="utf-8",
|
||||
)
|
||||
parser = _parser()
|
||||
planned = _run(
|
||||
parser.parse_args(["--project-root", str(root), "graph-plan", "architecture"])
|
||||
)
|
||||
self.assertEqual("architecture", planned["view_id"])
|
||||
rendered = _run(
|
||||
parser.parse_args(["--project-root", str(root), "graph-render", "architecture"])
|
||||
)
|
||||
self.assertEqual("current", rendered["state"])
|
||||
status = _run(
|
||||
parser.parse_args(
|
||||
["--project-root", str(root), "graph-render-status", "architecture"]
|
||||
)
|
||||
)
|
||||
self.assertEqual("current", status["state"])
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue