From e7c7df7074a664175e96f17288aba1d3c190009b Mon Sep 17 00:00:00 2001 From: Patrick Kingston <66141901+pkingstonxyz@users.noreply.github.com> Date: Tue, 24 Jun 2025 16:41:06 -0400 Subject: [PATCH] Add test coverage to ansiballz builder source mapping (#85382) Should bring code coverage in _builder.py to 100%. --- test/units/_internal/_ansiballz/__init__.py | 0 .../_internal/_ansiballz/test_builder.py | 22 +++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 test/units/_internal/_ansiballz/__init__.py create mode 100644 test/units/_internal/_ansiballz/test_builder.py diff --git a/test/units/_internal/_ansiballz/__init__.py b/test/units/_internal/_ansiballz/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/test/units/_internal/_ansiballz/test_builder.py b/test/units/_internal/_ansiballz/test_builder.py new file mode 100644 index 00000000000..e48f7e0f997 --- /dev/null +++ b/test/units/_internal/_ansiballz/test_builder.py @@ -0,0 +1,22 @@ +from __future__ import annotations + +from ansible._internal._ansiballz._builder import ExtensionManager +from ansible.module_utils._internal._ansiballz._extensions import _pydevd + + +def test_debugger_source_mapping() -> None: + """Synthetic coverage for builder source mapping.""" + debug_options = _pydevd.Options(source_mapping={ + "ide/path.py": "controller/path.py", + "ide/something.py": "controller/not_match.py", + }) + + manager = ExtensionManager(debug_options) + manager.source_mapping.update({ + "controller/path.py": "zip/path.py", + "controller/other.py": "not_match.py", + }) + + extensions = manager.get_extensions() + + assert extensions['_pydevd']['source_mapping'] == {'controller/other.py': 'not_match.py', 'ide/path.py': 'zip/path.py'}