~helene-verhaeghe27/cairo-dock-core/bugfix

« back to all changes in this revision

Viewing changes to tests/TestSeparatorIcon.py

  • Committer: Fabrice Rey
  • Date: 2013-06-28 23:44:28 UTC
  • Revision ID: fabounet03@gmail.com-20130628234428-cwsvh6mexcfm0063
Added a test framework, and several tests

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
import os  # path
 
2
from Test import Test, key, set_param
 
3
from CairoDock import CairoDock
 
4
 
 
5
# Test separator
 
6
class TestSeparatorIcon(Test):
 
7
        def __init__(self, dock):
 
8
                Test.__init__(self, "Test separator icon", dock)
 
9
        
 
10
        def run(self):
 
11
                # add a new separator-icon
 
12
                conf_file = self.d.Add({'type':'Separator', 'order':'3'})
 
13
                if conf_file == None or conf_file == "" or not os.path.exists(conf_file):
 
14
                        self.print_error ("Failed to add the separator")
 
15
                
 
16
                # remove the separator
 
17
                self.d.Remove('config-file='+conf_file)
 
18
                if len (self.d.GetProperties('config-file='+conf_file)) != 0:  # check that it has been deleted
 
19
                        self.print_error ("Failed to remove the separator")
 
20
                
 
21
                if os.path.exists(conf_file):  # check that it has been removed from the theme
 
22
                        self.print_error ("Failed to remove the separator from the theme")
 
23
                
 
24
                self.end()