You've already forked MicroPythonOS
mirror of
https://github.com/m5stack/MicroPythonOS.git
synced 2026-05-20 11:51:27 -07:00
Add testing imports
This commit is contained in:
@@ -20,9 +20,10 @@ from .ui.settings_activity import SettingsActivity
|
||||
from .ui.camera_activity import CameraActivity
|
||||
from .ui.keyboard import MposKeyboard
|
||||
from .ui.testing import (
|
||||
wait_for_render, capture_screenshot, simulate_click,
|
||||
find_label_with_text, verify_text_present, print_screen_labels,
|
||||
click_button, click_label, click_keyboard_button
|
||||
wait_for_render, capture_screenshot, simulate_click, get_widget_coords,
|
||||
find_label_with_text, verify_text_present, print_screen_labels, find_text_on_screen,
|
||||
click_button, click_label, click_keyboard_button, find_button_with_text,
|
||||
get_all_widgets_with_text
|
||||
)
|
||||
|
||||
# UI utility functions
|
||||
@@ -85,9 +86,10 @@ __all__ = [
|
||||
"shutdown", "set_foreground_app", "get_foreground_app",
|
||||
"focus_direction",
|
||||
# Testing utilities
|
||||
"wait_for_render", "capture_screenshot", "simulate_click",
|
||||
"find_label_with_text", "verify_text_present", "print_screen_labels",
|
||||
"click_button", "click_label", "click_keyboard_button",
|
||||
"wait_for_render", "capture_screenshot", "simulate_click", "get_widget_coords",
|
||||
"find_label_with_text", "verify_text_present", "print_screen_labels", "find_text_on_screen",
|
||||
"click_button", "click_label", "click_keyboard_button", "find_button_with_text",
|
||||
"get_all_widgets_with_text"
|
||||
# Submodules
|
||||
"apps", "ui", "config", "net", "content", "time", "sensor_manager",
|
||||
"sdcard", "battery_voltage", "audio", "hardware", "bootloader"
|
||||
|
||||
@@ -87,15 +87,15 @@ class TestConnectivityManagerWithNetwork(unittest.TestCase):
|
||||
cm = self.ConnectivityManager()
|
||||
|
||||
# Should have network checking capability
|
||||
self.assertTrue(cm.can_check_network)
|
||||
self.assertTrue(cm.can_check_network, "a")
|
||||
|
||||
# Should have created WLAN instance
|
||||
self.assertIsNotNone(cm.wlan)
|
||||
self.assertIsNotNone(cm.wlan, "b")
|
||||
|
||||
# Should have created timer
|
||||
timer = MockTimer.get_timer(1)
|
||||
self.assertIsNotNone(timer)
|
||||
self.assertTrue(timer.active)
|
||||
self.assertTrue(timer.active, "c")
|
||||
self.assertEqual(timer.period, 8000)
|
||||
self.assertEqual(timer.mode, MockTimer.PERIODIC)
|
||||
|
||||
Reference in New Issue
Block a user