Skip to content

Commit 88f3a9d

Browse files
committed
Try to increase test coverage
1 parent 6defb5f commit 88f3a9d

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
digraph "packages_depth_limited" {
2+
rankdir=BT
3+
charset="utf-8"
4+
"data" [color="black", label=<data>, shape="box", style="solid"];
5+
"data.clientmodule_test" [color="black", label=<data.clientmodule_test>, shape="box", style="solid"];
6+
"data.nullable_pattern" [color="black", label=<data.nullable_pattern>, shape="box", style="solid"];
7+
"data.property_pattern" [color="black", label=<data.property_pattern>, shape="box", style="solid"];
8+
"data.suppliermodule_test" [color="black", label=<data.suppliermodule_test>, shape="box", style="solid"];
9+
}

tests/pyreverse/test_writer.py

+14
Original file line numberDiff line numberDiff line change
@@ -338,3 +338,17 @@ def test_should_show_node_classes(
338338
f"{writer.should_show_node(path, is_class=True)}"
339339
)
340340
assert writer.should_show_node(path, is_class=True) == should_show
341+
342+
343+
def test_depth_limited_write(
344+
default_config: PyreverseConfig, get_project: GetProjectCallable
345+
) -> None:
346+
"""Test package diagram generation with a depth limit of 1."""
347+
writer = DiagramWriter(default_config)
348+
project = get_project(TEST_DATA_DIR, name="depth_limited")
349+
linker = Linker(project)
350+
handler = DiadefsHandler(default_config)
351+
dd = DefaultDiadefGenerator(linker, handler).visit(project)
352+
writer.max_depth = 1
353+
writer.write(dd)
354+
_assert_files_are_equal("packages_depth_limited.dot")

0 commit comments

Comments
 (0)