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
24 lines
697 B
Python
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)
|