Add Server Buddy desktop app with local Linux assessment and reporting

This commit is contained in:
2026-10-30 09:46:01 -07:00
commit 365f97942a
29 changed files with 1789 additions and 0 deletions

17
tests/test_startup.py Normal file
View File

@@ -0,0 +1,17 @@
import unittest
from unittest.mock import patch
from server_buddy.core.startup import desktop_error
class StartupTests(unittest.TestCase):
@patch('server_buddy.core.startup.sys.platform', 'linux')
@patch.dict('os.environ', {'DISPLAY': ':0', 'QT_QPA_PLATFORM': 'xcb'}, clear=True)
@patch('server_buddy.core.startup.ctypes.CDLL', side_effect=OSError)
def test_missing_xcb_returns_install_instruction(self, loader):
self.assertIn('sudo apt install libxcb-cursor0', desktop_error())
@patch('server_buddy.core.startup.sys.platform', 'linux')
@patch.dict('os.environ', {'QT_QPA_PLATFORM': 'offscreen'}, clear=True)
@patch('server_buddy.core.startup.ctypes.CDLL')
def test_offscreen_does_not_require_xcb(self, loader):
self.assertIsNone(desktop_error())
loader.assert_not_called()