2
from Test import Test, key, set_param
3
from CairoDock import CairoDock
6
class TestIconManager(Test):
7
def __init__(self, dock):
9
self.dt = .3 # time to update the dock size
10
Test.__init__(self, "Test Icons", dock)
14
props = self.d.GetProperties('type=Dock')
15
height_ini = props[0]['height']
17
# change the icons size and check that the dock size is updated
18
# Note: if the screen is too small, the size might not change at all
19
set_param (self.get_conf_file(), "Icons", "launcher size", "48;48") # from 40 to 48
20
self.d.Reload('type=Manager & name='+self.mgr)
21
sleep(self.dt) # let the 'configure' event arrive
23
props = self.d.GetProperties('type=Dock')
24
height = props[0]['height']
26
if height == height_ini:
27
self.print_error ('The dock size has not been updated')
28
elif height != height_ini + 17: # (48-40)*(1.75 + .4) = 17 (.4 = reflect height, not impacted by the zoom)
29
self.print_error ('The dock height is wrong (should be %d but is %d)' % (height_ini + 17, height))
31
set_param (self.get_conf_file(), "Icons", "launcher size", "40;40") # back to normal
32
set_param (self.get_conf_file(), "Icons", "zoom max", "2") # from 1.75 to 2
33
self.d.Reload('type=Manager & name='+self.mgr)
34
sleep(self.dt) # let the 'configure' event arrive
36
props = self.d.GetProperties('type=Dock')
37
height = props[0]['height']
39
if height != height_ini + 10: # 40*(2-1.75) = 10 (the reflect is not impacted by the zoom)
40
self.print_error ('The dock height is wrong (should be %d but is %d)' % (height_ini + 10, height))
42
set_param (self.get_conf_file(), "Icons", "zoom max", "1.75") # back to normal
43
self.d.Reload('type=Manager & name='+self.mgr)