Option C Tools
Loading...
Searching...
No Matches
tests_deps.test_dotted_keys Namespace Reference

Functions

None test_module_name_for_nested_module (Path tmp_path)
None test_module_name_for_init_collapses_to_package (Path tmp_path)
None test_build_dependency_graph_no_stem_collision (Path tmp_path)

Detailed Description

Purpose
-------
OI-521 regression coverage — ``oct.deps.oct_deps.build_dependency_graph``
must key modules by their dotted import path (``pkg.sub.module``) rather
than the bare file stem (``module``). The old behaviour silently dropped
every occurrence of a repeated stem on top of a single graph entry,
hiding both modules and their dependencies.

Responsibilities
----------------
- Verify ``module_name_for`` returns the dotted import path.
- Verify ``__init__.py`` resolves to its parent package's dotted name.
- Verify two files with the same stem in different packages produce
  distinct graph keys.

Diagnostics
-----------
Domain: DEPS-TESTS
Levels:
    L2 — test lifecycle
    L3 — assertion details
    L4 — deep tracing

Contracts
---------
- ``module_name_for(py_file, root)`` returns the dotted path.
- ``__init__.py`` resolves to its parent package's dotted name.
- Two files with the same stem in different packages both appear in the
  graph with distinct dotted keys (no collision).

Function Documentation

◆ test_build_dependency_graph_no_stem_collision()

None tests_deps.test_dotted_keys.test_build_dependency_graph_no_stem_collision ( Path tmp_path)
Two ``util.py`` files in different packages both land in the graph.

Definition at line 62 of file test_dotted_keys.py.

◆ test_module_name_for_init_collapses_to_package()

None tests_deps.test_dotted_keys.test_module_name_for_init_collapses_to_package ( Path tmp_path)
OI-521: ``pkg/__init__.py`` resolves to the package name ``pkg``.

Definition at line 54 of file test_dotted_keys.py.

◆ test_module_name_for_nested_module()

None tests_deps.test_dotted_keys.test_module_name_for_nested_module ( Path tmp_path)
OI-521: a module two packages deep gets a three-segment dotted key.

Definition at line 46 of file test_dotted_keys.py.