mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-11-09 22:13:43 +08:00
a82935f326
Integrate onroad views, configurable widgets, local settings, steering-profile contracts, Bluetooth and Android Auto with their device and runtime services. Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com> Co-authored-by: Daniel Koepping <elkoled@gmail.com> Co-authored-by: Danny <dannyirwin31@yahoo.com> Co-authored-by: DimitriChrysafis <Dimitri.chrysafis@gmail.com> Co-authored-by: Dom <168790843+firestar5683@users.noreply.github.com> Co-authored-by: Harald Schäfer <harald.the.engineer@gmail.com> Co-authored-by: Prabhaav Pillai <prabhaav@msu.edu> Co-authored-by: Shane Smiskol <shane@smiskol.com> Co-authored-by: dirwin31 <83434411+dirwin31@users.noreply.github.com> Co-authored-by: firestarsdog <229254897+firestarsdog@users.noreply.github.com> Co-authored-by: stef <19478336+stefpi@users.noreply.github.com> Co-authored-by: whoisdomi <dcantu83@gmail.com> Co-authored-by: Intelli <contact@intelli.software> Co-authored-by: pharmacomaniac <blittle65@gmail.com> Co-authored-by: prabhaavp <prabhaav@msu.edu>
31 lines
991 B
Python
31 lines
991 B
Python
"""The compact Galaxy action uses a reviewed image that Raylib can decode."""
|
|
|
|
import hashlib
|
|
import json
|
|
from pathlib import Path
|
|
import unittest
|
|
|
|
import pyray as rl
|
|
|
|
from openpilot.starpilot.ui.galaxy_access import GALAXY_ICON
|
|
|
|
|
|
class TestGalaxyAccessIcon(unittest.TestCase):
|
|
def test_compact_icon_is_tracked_reviewed_and_decodable(self):
|
|
root = Path(__file__).resolve().parents[3] / 'selfdrive/assets'
|
|
manifest = json.loads((Path(__file__).resolve().parents[1] / 'settings-assets.json').read_text())
|
|
entry = next(item for item in manifest['files'] if item['file'] == GALAXY_ICON)
|
|
raw = (root / GALAXY_ICON).read_bytes()
|
|
self.assertEqual(len(raw), entry['bytes'])
|
|
self.assertEqual(hashlib.sha256(raw).hexdigest(), entry['sha256'])
|
|
image = rl.load_image(str(root / GALAXY_ICON))
|
|
try:
|
|
self.assertGreater(image.width, 0)
|
|
self.assertGreater(image.height, 0)
|
|
finally:
|
|
rl.unload_image(image)
|
|
|
|
|
|
if __name__ == '__main__':
|
|
unittest.main()
|