fix: uncalculated dynamic

This commit is contained in:
egarette@silique.fr 2025-10-18 11:50:49 +02:00
parent 3fad16d0ac
commit d1add3dc5a
2 changed files with 4 additions and 9 deletions

View file

@ -485,24 +485,21 @@ def test_dyndescription_subdyn():
assert set(cfg.option('od.dod2.dod.st').property.get(uncalculated=True)) == {'validator'}
with pytest.raises(AttributeOptionError):
cfg.option('od.dod2.dodval1.st').property.get(uncalculated=True)
with pytest.raises(AttributeOptionError):
cfg.option('od.dod2val1.dod.st').property.get(uncalculated=True)
assert cfg.option('od.dod2val1.dod.st').property.get(uncalculated=True) == {'validator'}
#
with pytest.raises(AttributeOptionError):
cfg.option('od.dod2.dod.st').name()
with pytest.raises(AttributeOptionError):
cfg.option('od.dod2val1.dod.st').name()
assert cfg.option('od.dod2.dod.st').name(uncalculated=True) == 'st'
with pytest.raises(AttributeOptionError):
cfg.option('od.dod2val1.dod.st').name(uncalculated=True)
cfg.option('od.dod2val1.dod.st').name(uncalculated=True)
#
with pytest.raises(AttributeOptionError):
cfg.option('od.dod2.dod.st').path()
with pytest.raises(AttributeOptionError):
cfg.option('od.dod2val1.dod.st').path()
assert cfg.option('od.dod2.dod.st').path(uncalculated=True) == 'od.dod2.dod.st'
with pytest.raises(AttributeOptionError):
cfg.option('od.dod2val1.dod.st').path(uncalculated=True)
assert cfg.option('od.dod2val1.dod.st').path(uncalculated=True) == 'od.dod2.dod.st'
#
assert cfg.option('od.dod2.dod.st').isoptiondescription() is False
assert cfg.option('od.dod2val1.dodval1.st').isoptiondescription() is False

View file

@ -286,6 +286,7 @@ class SubConfig:
check_dynamic_without_identifiers
and parent
and parent.is_dynamic
and parent.is_dynamic_without_identifiers
and self.is_dynamic_without_identifiers
!= parent.is_dynamic_without_identifiers
):
@ -742,11 +743,9 @@ class _Config(CCache):
len_path = len(paths) - 1
for idx, name in enumerate(paths):
if idx != len_path:
check_dynamic_without_identifiers=True
index_ = None
true_path_ = None
else:
check_dynamic_without_identifiers=not allow_dynoption
index_ = index
true_path_ = true_path
@ -797,7 +796,6 @@ class _Config(CCache):
name=name,
identifier=identifier,
true_path=true_path_,
check_dynamic_without_identifiers=check_dynamic_without_identifiers,
)
return subconfig