Skip to content

Commit d46af08

Browse files
author
Lee Miller
committed
A rather rudimentary test with basic checks for the style setting
1 parent 0ccbf68 commit d46af08

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

src/bitmessageqt/tests/settings.py

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
"""Tests for PyBitmessage settings"""
12
import threading
23
import time
34

@@ -14,8 +15,7 @@ def setUp(self):
1415

1516
def test_udp(self):
1617
"""Test the effect of checkBoxUDP"""
17-
udp_setting = config.safeGetBoolean(
18-
'bitmessagesettings', 'udp')
18+
udp_setting = config.safeGetBoolean('bitmessagesettings', 'udp')
1919
self.assertEqual(udp_setting, self.dialog.checkBoxUDP.isChecked())
2020
self.dialog.checkBoxUDP.setChecked(not udp_setting)
2121
self.dialog.accept()
@@ -32,3 +32,22 @@ def test_udp(self):
3232
else:
3333
if not udp_setting:
3434
self.fail('No Announcer thread found while udp set to True')
35+
36+
def test_styling(self):
37+
"""Test custom windows style and font"""
38+
style_setting = config.safeGet('bitmessagesettings', 'windowstyle')
39+
font_setting = config.safeGet('bitmessagesettings', 'font')
40+
self.assertIs(style_setting, None)
41+
self.assertIs(font_setting, None)
42+
style_control = self.dialog.comboBoxStyle
43+
self.assertEqual(style_control.currentText(), 'GTK+')
44+
style_count = style_control.count()
45+
self.assertGreater(style_count, 1)
46+
for i in range(style_count):
47+
if i != style_control.currentIndex():
48+
style_control.setCurrentIndex(i)
49+
break
50+
self.dialog.accept()
51+
self.assertEqual(
52+
config.safeGet('bitmessagesettings', 'windowstyle'),
53+
style_control.currentText())

0 commit comments

Comments
 (0)