30 lines
1.1 KiB
Python
30 lines
1.1 KiB
Python
import unittest
|
|
from pathlib import Path
|
|
|
|
|
|
ROOT = Path(__file__).resolve().parents[1]
|
|
|
|
|
|
class Branding043RegressionTests(unittest.TestCase):
|
|
def test_application_no_longer_uses_generic_network_wired_icon(self):
|
|
main = (ROOT / "src/librenet_scanner/main.py").read_text()
|
|
self.assertNotIn('QIcon.fromTheme("network-wired")', main)
|
|
self.assertIn('librenet-scanner.svg', main)
|
|
self.assertIn('QIcon.fromTheme(APP_ICON_NAME)', main)
|
|
|
|
def test_plasma_desktop_file_identity_is_declared(self):
|
|
main = (ROOT / "src/librenet_scanner/main.py").read_text()
|
|
desktop = (ROOT / "assets/librenet-scanner.desktop").read_text()
|
|
self.assertIn('setDesktopFileName(APP_DESKTOP_ID)', main)
|
|
self.assertIn('Icon=librenet-scanner', desktop)
|
|
self.assertIn('StartupWMClass=librenet-scanner', desktop)
|
|
|
|
def test_main_window_receives_same_application_icon(self):
|
|
main = (ROOT / "src/librenet_scanner/main.py").read_text()
|
|
self.assertIn('app.setWindowIcon(icon)', main)
|
|
self.assertIn('window.setWindowIcon(icon)', main)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
unittest.main()
|