Skip to content

Commit

Permalink
fix: tweak pack bool
Browse files Browse the repository at this point in the history
  • Loading branch information
vberlier committed Jun 18, 2022
1 parent 6031c88 commit 693f30e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 5 additions & 1 deletion beet/library/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -818,7 +818,11 @@ def __eq__(self, other: Any) -> bool:
return NotImplemented

def __bool__(self) -> bool:
return any(self.values()) or self.extra.keys() > {"pack.mcmeta"}
return (
any(self.values())
or self.extra.keys() > {"pack.mcmeta"}
or self.mcmeta != self.__class__().mcmeta
)

def __enter__(self: T) -> T:
return self
Expand Down
1 change: 0 additions & 1 deletion tests/test_resource_pack.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ def test_default():
)
def test_empty(snapshot: SnapshotFixture, pack: ResourcePack):
assert snapshot("resource_pack") == pack
assert not pack
assert dict(pack) == {}


Expand Down

0 comments on commit 693f30e

Please sign in to comment.