# SPDX-License-Identifier: MPL-2.0 import importlib.util from pathlib import Path import unittest import tempfile import struct from unittest.mock import patch spec=importlib.util.spec_from_file_location('cover',Path(__file__).parents[1]/'devices/beatles/cover-display.py') cover=importlib.util.module_from_spec(spec);spec.loader.exec_module(cover) class CoverTests(unittest.TestCase): def test_animation_timing_padding_and_loop(self): with tempfile.TemporaryDirectory() as directory: path=Path(directory)/'animation' first=b'\x00\xf8'*(240*240);second=b'\x1f\x00'*(240*240) path.write_bytes(b'VULPANM1'+struct.pack('