Skip to content

Commit

Permalink
fix: rename pack image
Browse files Browse the repository at this point in the history
  • Loading branch information
vberlier committed May 5, 2021
1 parent f57ea93 commit a3007a1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions beet/library/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ class Pack(MatchMixin, MergeMixin, Container[str, NamespaceType]):
mcmeta: ExtraPin[JsonFile] = ExtraPin(
"pack.mcmeta", default_factory=lambda: JsonFile({})
)
image: ExtraPin[Optional[PngFile]] = ExtraPin("pack.png", default=None)
icon: ExtraPin[Optional[PngFile]] = ExtraPin("pack.png", default=None)

description: PackPin[TextComponent] = PackPin("description", default="")
pack_format: PackPin[int] = PackPin("pack_format", default=0)
Expand All @@ -362,7 +362,7 @@ def __init__(
zipfile: Optional[ZipFile] = None,
zipped: bool = False,
mcmeta: Optional[JsonFile] = None,
image: Optional[PngFile] = None,
icon: Optional[PngFile] = None,
description: Optional[str] = None,
pack_format: Optional[int] = None,
):
Expand All @@ -375,8 +375,8 @@ def __init__(

if mcmeta is not None:
self.mcmeta = mcmeta
if image is not None:
self.image = image
if icon is not None:
self.icon = icon
if description is not None:
self.description = description
if pack_format is not None:
Expand Down
8 changes: 4 additions & 4 deletions tests/test_resource_pack.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ def test_empty(snapshot: SnapshotFixture, pack: ResourcePack):


def test_empty_with_image():
pack = ResourcePack(image=PngFile(Image.new("RGB", (32, 32), color="blue")))
pack = ResourcePack(icon=PngFile(Image.new("RGB", (32, 32), color="blue")))
assert pack
assert pack == ResourcePack(image=PngFile(Image.new("RGB", (32, 32), color="blue")))
assert pack != ResourcePack(image=PngFile(Image.new("RGB", (32, 32), color="red")))
assert pack != ResourcePack(image=PngFile(Image.new("RGB", (16, 16), color="blue")))
assert pack == ResourcePack(icon=PngFile(Image.new("RGB", (32, 32), color="blue")))
assert pack != ResourcePack(icon=PngFile(Image.new("RGB", (32, 32), color="red")))
assert pack != ResourcePack(icon=PngFile(Image.new("RGB", (16, 16), color="blue")))
assert dict(pack) == {}


Expand Down

0 comments on commit a3007a1

Please sign in to comment.