Files
soundtower-controller/tests/test_imports.py
T
lda Verified 038e152bbc
Checks / tests (ubuntu-latest, 3.11) (push) Canceled after 0s
Checks / tests (ubuntu-latest, 3.14) (push) Canceled after 0s
Checks / tests (windows-latest, 3.11) (push) Canceled after 0s
Checks / tests (windows-latest, 3.14) (push) Canceled after 0s
Checks / package (push) Canceled after 0s
Add MX-T40 BLE desktop controller and protocol documentation
2026-10-25 04:43:47 +07:00

24 lines
697 B
Python

"""The protocol and CLI must remain usable on machines without a display."""
import subprocess
import sys
import unittest
class ImportTests(unittest.TestCase):
def test_headless_import_and_help(self):
script = """
import sys
from controller import protocol, session, messages, cli
assert 'tkinter' not in sys.modules
assert 'bleak' not in sys.modules
try:
cli.main(['--help'])
except SystemExit as exc:
assert exc.code == 0
assert 'tkinter' not in sys.modules
"""
result = subprocess.run([sys.executable, "-c", script], capture_output=True, text=True)
self.assertEqual(result.returncode, 0, result.stderr)
self.assertIn("--transport", result.stdout)