fix(manifest): preserve declared boolean fields
tracker-policy-pr / check-pr (pull_request) Successful in 11s
test / integration-docker (pull_request) Successful in 18s
test / unit (pull_request) Successful in 42s
test / integration-firecracker (pull_request) Successful in 3m35s
test / coverage (pull_request) Successful in 26s
test / publish-infra (pull_request) Has been skipped
prd-number / assign-numbers (push) Failing after 29s
test / integration-docker (push) Successful in 44s
lint / lint (push) Successful in 1m0s
test / unit (push) Successful in 56s
Update Quality Badges / update-badges (push) Successful in 1m45s
test / integration-firecracker (push) Successful in 6m54s
test / coverage (push) Successful in 26s
test / publish-infra (push) Successful in 2m22s
tracker-policy-pr / check-pr (pull_request) Successful in 11s
test / integration-docker (pull_request) Successful in 18s
test / unit (pull_request) Successful in 42s
test / integration-firecracker (pull_request) Successful in 3m35s
test / coverage (pull_request) Successful in 26s
test / publish-infra (pull_request) Has been skipped
prd-number / assign-numbers (push) Failing after 29s
test / integration-docker (push) Successful in 44s
lint / lint (push) Successful in 1m0s
test / unit (push) Successful in 56s
Update Quality Badges / update-badges (push) Successful in 1m45s
test / integration-firecracker (push) Successful in 6m54s
test / coverage (push) Successful in 26s
test / publish-infra (push) Successful in 2m22s
This commit was merged in pull request #456.
This commit is contained in:
@@ -68,6 +68,23 @@ class TestExtendsBasic(unittest.TestCase):
|
||||
self.assertTrue(m.bottles["base"].supervise)
|
||||
self.assertFalse(m.bottles["off"].supervise)
|
||||
|
||||
def test_child_overrides_nested_containers_scalar(self):
|
||||
m = _build(
|
||||
base={"nested_containers": True},
|
||||
off={"extends": "base", "nested_containers": False},
|
||||
)
|
||||
self.assertTrue(m.bottles["base"].nested_containers)
|
||||
self.assertFalse(m.bottles["off"].nested_containers)
|
||||
|
||||
def test_inherited_boolean_declaration_is_preserved(self):
|
||||
m = _build(
|
||||
base={"nested_containers": True, "supervise": False},
|
||||
child={"extends": "base"},
|
||||
)
|
||||
child = m.bottles["child"]
|
||||
self.assertIn("nested_containers", child.declared_fields)
|
||||
self.assertIn("supervise", child.declared_fields)
|
||||
|
||||
def test_parent_resolved_once_for_multiple_children(self):
|
||||
# Two children sharing one parent: both inherit; the parent
|
||||
# is resolved once + cached. (Cache behavior is internal; we
|
||||
@@ -477,6 +494,26 @@ class TestExtendsMultiParent(unittest.TestCase):
|
||||
)
|
||||
self.assertTrue(m.bottles["child"].supervise)
|
||||
|
||||
def test_later_parent_omitting_boole_preserves_earlier_values(self):
|
||||
m = _build(
|
||||
p1={"nested_containers": True, "supervise": False},
|
||||
p2={"env": {"FROM_P2": "1"}},
|
||||
child={"extends": ["p1", "p2"]},
|
||||
)
|
||||
child = m.bottles["child"]
|
||||
self.assertTrue(child.nested_containers)
|
||||
self.assertFalse(child.supervise)
|
||||
|
||||
def test_later_parent_explicit_boole_override_earlier_values(self):
|
||||
m = _build(
|
||||
p1={"nested_containers": True, "supervise": False},
|
||||
p2={"nested_containers": False, "supervise": True},
|
||||
child={"extends": ["p1", "p2"]},
|
||||
)
|
||||
child = m.bottles["child"]
|
||||
self.assertFalse(child.nested_containers)
|
||||
self.assertTrue(child.supervise)
|
||||
|
||||
def test_child_supervise_overrides_all_parents(self):
|
||||
m = _build(
|
||||
p1={"supervise": True},
|
||||
|
||||
Reference in New Issue
Block a user