MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / run_tests

Function run_tests

tests/test_pager_code.py:456–656  ·  view source on GitHub ↗

Execute all tests.

()

Source from the content-addressed store, hash-verified

454
455
456def run_tests():
457 """Execute all tests."""
458 print("=" * 60)
459 print("Pager Code Test - Using MockPager (no hardware required)")
460 print("=" * 60)
461 print()
462
463 if VERBOSE:
464 print("[INFO] Verbose mode enabled - showing all mock draw calls")
465 print()
466
467 errors = []
468 warnings = []
469
470 # ========== TEST 1: pager_menu.py ==========
471 print("[TEST 1] Importing pager_menu.py...")
472 try:
473 import pager_menu
474 print("[OK] pager_menu.py imported successfully")
475 except Exception as e:
476 print(f"[FAIL] pager_menu.py: {e}")
477 import traceback
478 traceback.print_exc()
479 errors.append(('pager_menu.py', str(e)))
480
481 print()
482
483 # ========== TEST 2: pager_display.py ==========
484 print("[TEST 2] Importing pager_display.py...")
485 try:
486 import pager_display
487 print("[OK] pager_display.py imported successfully")
488 except Exception as e:
489 print(f"[FAIL] pager_display.py: {e}")
490 import traceback
491 traceback.print_exc()
492 errors.append(('pager_display.py', str(e)))
493
494 print()
495
496 # ========== TEST 3: PagerRagnar.py syntax ==========
497 print("[TEST 3] Checking PagerRagnar.py syntax...")
498 try:
499 import importlib.util
500 spec = importlib.util.spec_from_file_location("PagerRagnar",
501 os.path.join(os.path.dirname(__file__), "PagerRagnar.py"))
502 pager_ragnar = importlib.util.module_from_spec(spec)
503 print("[OK] PagerRagnar.py syntax OK")
504 except Exception as e:
505 print(f"[FAIL] PagerRagnar.py: {e}")
506 import traceback
507 traceback.print_exc()
508 errors.append(('PagerRagnar.py', str(e)))
509
510 print()
511
512 # ========== TEST 4: RagnarMenu instantiation ==========
513 print("[TEST 4] Testing pager_menu.RagnarMenu instantiation...")

Callers 1

test_pager_code.pyFile · 0.70

Calls 15

cleanupMethod · 0.95
cleanupMethod · 0.95
initMethod · 0.95
set_rotationMethod · 0.95
clearMethod · 0.95
fill_rectMethod · 0.95
rectMethod · 0.95
draw_textMethod · 0.95
draw_ttfMethod · 0.95
flipMethod · 0.95
get_battery_percentMethod · 0.95
set_brightnessMethod · 0.95

Tested by

no test coverage detected