Add Server Buddy desktop app with local Linux assessment and reporting
This commit is contained in:
17
tests/test_startup.py
Normal file
17
tests/test_startup.py
Normal 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()
|
||||
Reference in New Issue
Block a user