Skip to content

Commit f3a7e6d

Browse files
committed
test(models): ✅ cover profile resoution from
extra_profiles_path
1 parent 7b3e8bc commit f3a7e6d

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

tests/unit/test_cli_internals.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,3 +81,22 @@ def test_compute_stats(fake_profiles_path):
8181
_.requirement.profile.identifier == "a"}
8282

8383
logger.error(stats)
84+
85+
86+
def test_compute_stats_resolves_profile_from_extra_profiles_path(fake_profiles_path):
87+
# ValidationStatistics.__initialise__ used to call Profile.load_profiles
88+
# without forwarding extra_profiles_path, so any profile that lived only
89+
# under --extra-profiles-path raised ProfileNotFound.
90+
settings = ValidationSettings.parse({
91+
"profiles_path": DEFAULT_PROFILES_PATH,
92+
"extra_profiles_path": fake_profiles_path,
93+
"profile_identifier": "a",
94+
"enable_profile_inheritance": True,
95+
"allow_requirement_check_override": True,
96+
"requirement_severity": "REQUIRED",
97+
})
98+
99+
stats = ValidationStatistics.__initialise__(validation_settings=settings)
100+
101+
assert any(p.identifier == "a" for p in stats["profiles"]), \
102+
"Profile 'a' from extra_profiles_path was not resolved by ValidationStatistics"

0 commit comments

Comments
 (0)