1+ """Tests for PyBitmessage settings"""
12import threading
23import 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