2
import os # system, path
3
from Test import Test, key, set_param
4
from CairoDock import CairoDock
8
class TestLauncher(Test):
9
def __init__(self, dock):
10
self.exe = config.exe1
11
self.wmclass = config.wmclass1
12
self.desktop_file = config.desktop_file1
13
Test.__init__(self, "Test launcher", dock)
16
os.system('killall -q '+self.exe)
18
self.d.Remove('type=Launcher & class='+self.wmclass)
21
conf_file = self.d.Add({'type':'Launcher', 'position':1, 'config-file':'application://'+self.desktop_file})
22
if conf_file == None or conf_file == "" or not os.path.exists(conf_file):
23
self.print_error ("Failed to add the launcher")
25
# activate the launcher and check that it launches the program
27
key("2") # 'position' starts from 0, but numbers on the icons start from 1
29
os.system('pgrep -f '+self.exe)
32
self.d.Remove('config-file='+conf_file)
33
if len (self.d.GetProperties('config-file='+conf_file)) != 0: # check that it has been deleted
34
self.print_error ("Failed to remove the launcher")
36
if os.path.exists(conf_file): # check that it has been removed from the theme
37
self.print_error ("Failed to remove the launcher from the theme")