tests.test_dep_graph moduleΒΆ

Tests for repomatic.deps.dep_graph: the Mermaid dependency-graph generator.

tests.test_dep_graph.test_normalize_package_name(name, expected)[source]ΒΆ
Return type:

None

tests.test_dep_graph.test_subgraph_identity(kind, name, mermaid_id, title)[source]ΒΆ
Return type:

None

tests.test_dep_graph.test_build_dependency_graph()[source]ΒΆ
Return type:

None

tests.test_dep_graph.test_filter_root_edges_drops_group_package_pulled_in_by_an_extra()[source]ΒΆ

A group package an extra drags in is not a main dependency.

uv’s CycloneDX export hangs requests off the root because the test group declares it, though only the sphinx extra pulls it in. Exporting with no --group at all still produces that edge.

Return type:

None

tests.test_dep_graph.test_filter_root_edges_without_lock_data()[source]ΒΆ

Missing lock data is not evidence that a root edge is spurious.

Return type:

None

tests.test_dep_graph.test_filter_root_edges_with_no_main_dependencies()[source]ΒΆ

A project declaring nothing unconditionally keeps only box-owned edges.

An empty mapping states that much, where None states nothing at all.

Return type:

None

tests.test_dep_graph.test_render_mermaid_after_filtering_root_edges()[source]ΒΆ

The dropped package renders as a transitive oval, outside every box.

Return type:

None

tests.test_dep_graph.test_filter_graph_to_package()[source]ΒΆ
Return type:

None

tests.test_dep_graph.test_trim_graph_to_depth(depth, packages, edge_count)[source]ΒΆ

Trimming keeps every node within depth hops of the root, and no more.

Return type:

None

tests.test_dep_graph.test_render_mermaid()[source]ΒΆ
Return type:

None

tests.test_dep_graph.test_render_mermaid_with_specifiers()[source]ΒΆ
Return type:

None

tests.test_dep_graph.test_render_mermaid_with_groups()[source]ΒΆ
Return type:

None

tests.test_dep_graph.test_render_mermaid_with_subgraph_specifiers()[source]ΒΆ
Return type:

None

tests.test_dep_graph.test_render_mermaid_transitive_deps_outside_box()[source]ΒΆ
Return type:

None

tests.test_dep_graph.test_render_mermaid_with_extras()[source]ΒΆ
Return type:

None

tests.test_dep_graph.test_render_mermaid_skips_filtered_out_box()[source]ΒΆ
Return type:

None

tests.test_dep_graph.test_attribute_subgraph_packages_duplicate_headlines()[source]ΒΆ
Return type:

None

tests.test_dep_graph.test_attribute_subgraph_packages_equivalent_subgraphs()[source]ΒΆ
Return type:

None

tests.test_dep_graph.test_attribute_subgraph_packages_dependents_tie_break()[source]ΒΆ
Return type:

None

tests.test_dep_graph.test_attribute_subgraph_packages_transitive_stays_out()[source]ΒΆ
Return type:

None

tests.test_dep_graph.test_render_mermaid_with_duplicate_headlines()[source]ΒΆ
Return type:

None

tests.test_dep_graph.test_compute_node_degrees()[source]ΒΆ
Return type:

None

tests.test_dep_graph.test_compute_subtree_sizes()[source]ΒΆ
Return type:

None

tests.test_dep_graph.test_compute_node_depths()[source]ΒΆ
Return type:

None

tests.test_dep_graph.test_cyclic_graph_traversals_terminate()[source]ΒΆ

Every graph traversal must terminate on cyclic input.

Without their visited guards, _compute_node_depths would loop forever and _compute_subtree_sizes would recurse infinitely on the apple <-> banana cycle, so reaching the asserts at all proves cycle-safety; the values pin the expected output.

Return type:

None

tests.test_dep_graph.test_render_mermaid_with_cycle()[source]ΒΆ

The full render path stays cycle-safe and emits the self-loop edge.

Return type:

None

tests.test_dep_graph.test_render_mermaid_primary_deps_ordering()[source]ΒΆ

Primary deps with larger subtrees should be declared first.

Return type:

None

tests.test_dep_graph.test_render_mermaid_edge_ordering()[source]ΒΆ

Root edges should come before transitive edges.

Return type:

None

tests.test_dep_graph.test_available_groups()[source]ΒΆ
Return type:

None

tests.test_dep_graph.test_available_extras(tmp_path)[source]ΒΆ
Return type:

None

tests.test_dep_graph.test_resolve_subgraph_selection()[source]ΒΆ
Return type:

None

tests.test_dep_graph.test_update_dep_graph_disabled_writes_nothing(tmp_path, monkeypatch)[source]ΒΆ

dependency-graph.update = false exits before reading the lockfile.

The directory holds no uv.lock, so the export would fail: a clean exit with no output file is reachable only through the guard.

Return type:

None