Skip to content

Commit 1c98097

Browse files
committed
fix: don't make overlays truthy when they just contain formats declaration
1 parent fd3e745 commit 1c98097

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

beet/library/base.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1093,7 +1093,6 @@ def __bool__(self) -> bool:
10931093
return (
10941094
any(self.values())
10951095
or self.extra.keys() > {"pack.mcmeta"}
1096-
or (self.overlay_parent is not None and self.supported_formats is not None)
10971096
or (self.overlay_parent is None and bool(self.overlays))
10981097
)
10991098

tests/test_data_pack.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -603,6 +603,7 @@ def test_overlay():
603603
b = p.overlays.setdefault(
604604
"b", supported_formats={"min_inclusive": 16, "max_inclusive": 17}
605605
)
606+
assert not b
606607
assert b.supported_formats == {"min_inclusive": 16, "max_inclusive": 17}
607608
assert p.mcmeta.data == {
608609
"pack": {"pack_format": 18, "description": ""},
@@ -627,6 +628,7 @@ def test_overlay():
627628
c["demo:thing"] = Function()
628629
p.overlays["c"] = c
629630

631+
assert c
630632
assert c.overlay_name == "c"
631633
assert c.overlay_parent is p
632634
assert dict(p.list_files()) == {

0 commit comments

Comments
 (0)