Skip to content

Commit

Permalink
Try to increase test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
Julfried committed Dec 26, 2024
1 parent e38b9e5 commit 58190bc
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/pyreverse/data/packages_depth_limited.dot
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
digraph "packages_depth_limited" {
rankdir=BT
charset="utf-8"
"data" [color="black", label=<data>, shape="box", style="solid"];
"data.clientmodule_test" [color="black", label=<data.clientmodule_test>, shape="box", style="solid"];
"data.nullable_pattern" [color="black", label=<data.nullable_pattern>, shape="box", style="solid"];
"data.property_pattern" [color="black", label=<data.property_pattern>, shape="box", style="solid"];
"data.suppliermodule_test" [color="black", label=<data.suppliermodule_test>, shape="box", style="solid"];
}
14 changes: 14 additions & 0 deletions tests/pyreverse/test_writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,3 +338,17 @@ def test_should_show_node_classes(
f"{writer.should_show_node(path, is_class=True)}"
)
assert writer.should_show_node(path, is_class=True) == should_show


def test_depth_limited_write(
default_config: PyreverseConfig, get_project: GetProjectCallable
) -> None:
"""Test package diagram generation with a depth limit of 1."""
writer = DiagramWriter(default_config)
project = get_project(TEST_DATA_DIR, name="depth_limited")
linker = Linker(project)
handler = DiadefsHandler(default_config)
dd = DefaultDiadefGenerator(linker, handler).visit(project)
writer.max_depth = 1
writer.write(dd)
_assert_files_are_equal("packages_depth_limited.dot")

0 comments on commit 58190bc

Please sign in to comment.