Add DeviceInfo and VersionInfo frameworks

This commit is contained in:
Thomas Farstrike
2026-01-24 23:32:10 +01:00
parent b8cc049e0e
commit f772fc4b80
10 changed files with 67 additions and 32 deletions
+5 -4
View File
@@ -18,7 +18,6 @@ Usage:
import unittest
import lvgl as lv
import mpos.apps
import mpos.info
import mpos.ui
import os
from mpos import (
@@ -26,7 +25,9 @@ from mpos import (
capture_screenshot,
find_label_with_text,
verify_text_present,
print_screen_labels
print_screen_labels,
DeviceInfo,
BuildInfo
)
@@ -51,7 +52,7 @@ class TestGraphicalAboutApp(unittest.TestCase):
pass # Directory already exists
# Store hardware ID for verification
self.hardware_id = mpos.info.get_hardware_id()
self.hardware_id = DeviceInfo.hardware_id
print(f"Testing with hardware ID: {self.hardware_id}")
def tearDown(self):
@@ -161,7 +162,7 @@ class TestGraphicalAboutApp(unittest.TestCase):
)
# Verify the actual version string is present
os_version = mpos.info.CURRENT_OS_VERSION
os_version = BuildInfo.version.release
self.assertTrue(
verify_text_present(screen, os_version),
f"OS version '{os_version}' not found on screen"
+6 -4
View File
@@ -11,7 +11,9 @@ from mpos import (
capture_screenshot,
find_label_with_text,
verify_text_present,
print_screen_labels
print_screen_labels,
DeviceInfo,
BuildInfo
)
@@ -148,7 +150,7 @@ class TestOSUpdateGraphicalUI(unittest.TestCase):
# Check that it contains the current version
label_text = version_label.get_text()
current_version = mpos.info.CURRENT_OS_VERSION
current_version = BuildInfo.version.release
self.assertIn(current_version, label_text,
f"Current version {current_version} not in label text: {label_text}")
@@ -186,7 +188,7 @@ class TestOSUpdateGraphicalStatusMessages(unittest.TestCase):
def setUp(self):
"""Set up test fixtures."""
self.hardware_id = mpos.info.get_hardware_id()
self.hardware_id = DeviceInfo.hardware_id
self.screenshot_dir = "tests/screenshots"
try:
@@ -243,7 +245,7 @@ class TestOSUpdateGraphicalScreenshots(unittest.TestCase):
def setUp(self):
"""Set up test fixtures."""
self.hardware_id = mpos.info.get_hardware_id()
self.hardware_id = DeviceInfo.hardware_id
self.screenshot_dir = "tests/screenshots"
try: