Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bongo_cat/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from .utils import resource_path, setup_logging
from . import animations

__version__ = "2.0.8"
__version__ = "2.0.9"
__author__ = "luinbytes"
__description__ = "Interactive desktop pet that responds to keyboard, mouse, and controller inputs"

Expand Down
4 changes: 0 additions & 4 deletions skins/neon/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,3 @@ If you create a custom neon skin you'd like to share:
1. Create a new folder in `skins/` with your theme name
2. Add your images and a `skin.json` file
3. Consider sharing it in the GitHub discussions!

---

*Current images are placeholders - replace with your own neon-styled artwork!*
Binary file modified skins/neon/cat-left.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified skins/neon/cat-rest.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified skins/neon/cat-right.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 0 additions & 4 deletions skins/retro/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,3 @@ If you create a custom retro skin you'd like to share:
1. Create a new folder in `skins/` with your theme name
2. Add your images and a `skin.json` file
3. Consider sharing it in the GitHub discussions!

---

*Current images are placeholders - replace with your own retro-styled artwork!*
Binary file modified skins/retro/cat-left.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified skins/retro/cat-rest.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified skins/retro/cat-right.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
36 changes: 36 additions & 0 deletions tests/test_skin_manager.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
import json
import os
from pathlib import Path
import struct
import tempfile
import unittest

from bongo_cat.models.skin_manager import SkinManager


BUILTIN_SKIN_IDS = ("default", "neon", "retro")
POSE_FILENAMES = ("cat-rest.png", "cat-left.png", "cat-right.png")


class TestSkinManagerPaths(unittest.TestCase):
def test_explicit_relative_skin_directory_stays_authoritative(self):
with tempfile.TemporaryDirectory() as working_dir:
Expand Down Expand Up @@ -40,5 +45,36 @@ def test_explicit_relative_skin_directory_stays_authoritative(self):
self.assertEqual(["fixture"], manager.get_skin_ids())


class TestBuiltInSkinAssets(unittest.TestCase):
def test_builtin_skin_assets_are_distinct_and_keep_dimensions(self):
repo_root = Path(__file__).resolve().parents[1]
skin_assets = {
skin_id: {
pose: repo_root / "skins" / skin_id / pose
for pose in POSE_FILENAMES
}
for skin_id in BUILTIN_SKIN_IDS
}

for skin_id in BUILTIN_SKIN_IDS[1:]:
for pose, default_path in skin_assets["default"].items():
with self.subTest(skin=skin_id, pose=pose):
self.assertNotEqual(
default_path.read_bytes(),
skin_assets[skin_id][pose].read_bytes(),
f"{skin_id}/{pose} must differ from default",
)

for skin_id, poses in skin_assets.items():
for pose, path in poses.items():
with self.subTest(skin=skin_id, pose=pose):
header = path.read_bytes()[:29]
self.assertEqual(b"\x89PNG\r\n\x1a\n", header[:8])
self.assertEqual(13, struct.unpack(">I", header[8:12])[0])
self.assertEqual(b"IHDR", header[12:16])
width, height = struct.unpack(">II", header[16:24])
self.assertEqual((200, 126), (width, height))


if __name__ == "__main__":
unittest.main()