diff options
| author | mhegazy <8000722+mhegazy@users.noreply.github.com> | 2026-11-04 20:04:40 +0000 |
|---|---|---|
| committer | Claude <noreply@anthropic.com> | 2026-11-04 20:04:40 +0000 |
| commit | a6e9f5b1f95d3b997cf496e58541fd80b0f2f934 (patch) | |
| tree | 4d827d659ea20f4e03f2e362c08a39609a9a1694 /plugins | |
| parent | 041575c85ebe9ddc2384e1f5b5e67c2669cb136a (diff) | |
security-guidance: test the reparse metric's folder walk with an absolute path on Windows
Co-authored-by: mhegazy <mhegazy@anthropic.com>
Diffstat (limited to 'plugins')
| -rw-r--r-- | plugins/security-guidance/tests/test_interp_reparse_metric.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/plugins/security-guidance/tests/test_interp_reparse_metric.py b/plugins/security-guidance/tests/test_interp_reparse_metric.py index 90cbc78d..5d3f6f13 100644 --- a/plugins/security-guidance/tests/test_interp_reparse_metric.py +++ b/plugins/security-guidance/tests/test_interp_reparse_metric.py @@ -141,10 +141,11 @@ def test_unreadable_folder_is_skipped(): def test_each_folder_is_looked_at_once_and_only_up_to_the_link(): - prefix = os.path.join(os.sep, "a", "b", "c") + # abspath: on Windows the metric adds the current drive. + prefix = os.path.abspath(os.path.join(os.sep, "a", "b", "c")) calls = [] measure(exe(prefix), prefix, calls=calls) - assert sorted(calls) == sorted({exe(prefix), prefix, os.path.dirname(prefix), os.path.join(os.sep, "a")}) + assert sorted(calls) == sorted({exe(prefix), prefix, os.path.dirname(prefix), os.path.dirname(os.path.dirname(prefix))}) calls.clear() measure(exe(prefix), prefix, {prefix: SYMLINK}, calls=calls) assert calls == [exe(prefix), prefix] |
