Ignore:
Timestamp:
Apr 18, 2011 11:16:39 AM (13 years ago)
Author:
vmaksymiv
Message:

pep8 fixes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • quintagroup.captcha.core/trunk/quintagroup/captcha/core/tests/testInstallation.py

    r1957 r3128  
    11from base import * 
     2 
    23 
    34class TestInstallation(ptc.FunctionalTestCase): 
     
    1516    def testPropertysheetInstall(self): 
    1617        pp = getToolByName(self.portal, 'portal_properties') 
    17         self.assert_(PROPERTY_SHEET in pp.objectIds(), 'Property sheet isn\'t found') 
     18        msg = 'Property sheet isn\'t found' 
     19        self.assert_(PROPERTY_SHEET in pp.objectIds(), msg) 
    1820 
    1921    def testPropertysheetUninstall(self): 
     
    2426 
    2527    def testConfigletInstall(self): 
    26         self.assert_(CONFIGLET_ID in [a.getId() for a in self.cp.listActions()], 'Configlet not found') 
     28        list_ids = [] 
     29        for action in self.cp.listActions(): 
     30            list_ids.append(action.getId()) 
     31        self.assert_(CONFIGLET_ID in list_ids, 'Configlet not found') 
    2732 
    2833    def testConfigletUninstall(self): 
    2934        self.qi.uninstallProducts([PRODUCT_NAME]) 
    30         self.assertNotEqual(self.qi.isProductInstalled(PRODUCT_NAME), True,'%s is already installed' % PRODUCT_NAME) 
    31         self.assert_(not CONFIGLET_ID in [a.getId() for a in self.cp.listActions()], 'Configlet found after uninstallation') 
     35        self.assertNotEqual(self.qi.isProductInstalled(PRODUCT_NAME), True, 
     36                            '%s is already installed' % PRODUCT_NAME) 
     37        list_ids = [] 
     38        for action in self.cp.listActions(): 
     39            list_ids.append(action.getId()) 
     40        msg = 'Configlet found after uninstallation' 
     41        self.assert_(not CONFIGLET_ID in list_ids, msg) 
    3242 
    3343    def testSkinsInstall(self): 
     
    3848            path = map(str.strip, path.split(',')) 
    3949            for layer in layers: 
    40                 self.assert_(layer.split('/')[0] in skinstool.objectIds(), '%s directory view not found in portal_skins after installation' % layer) 
    41                 self.assert_(layer in path, '%s layer not found in %s' % (PRODUCT_NAME, skin)) 
     50                msg = '%s directory view not found in'\ 
     51                      'portal_skins after installation' % layer 
     52                self.assert_(layer.split('/')[0] in skinstool.objectIds(), msg) 
     53                msg = '%s layer not found in %s' % (PRODUCT_NAME, skin) 
     54                self.assert_(layer in path, msg) 
    4255 
    4356    def testSkinsUninstall(self): 
    4457        self.qi.uninstallProducts([PRODUCT_NAME]) 
    45         self.assertNotEqual(self.qi.isProductInstalled(PRODUCT_NAME), True,'%s is already installed' % PRODUCT_NAME) 
     58        self.assertNotEqual(self.qi.isProductInstalled(PRODUCT_NAME), True, 
     59                            '%s is already installed' % PRODUCT_NAME) 
    4660        skinstool = self.st 
    4761        layers = self.getLayers() 
     
    5064            path = map(str.strip, path.split(',')) 
    5165            for layer in layers: 
    52                 self.assert_(not layer.split('/')[0] in skinstool.objectIds(), '%s directory view found in portal_skins after uninstallation' % layer) 
    53                 self.assert_(not layer in path, '%s layer found in %s after uninstallation' % (layer, skin)) 
     66                msg = '%s directory view found in'\ 
     67                      'portal_skins after uninstallation' % layer 
     68                skins_tool_ids = skinstool.objectIds() 
     69                self.assert_(not layer.split('/')[0] in skins_tool_ids, msg) 
     70                msg = '%s layer found in'\ 
     71                      '%s after uninstallation' % (layer, skin) 
     72                self.assert_(not layer in path, msg) 
    5473 
    5574    def testToolInstall(self): 
     
    5877    def testToolUninstall(self): 
    5978        self.qi.uninstallProducts([PRODUCT_NAME]) 
    60         self.assertNotEqual(self.qi.isProductInstalled(PRODUCT_NAME), True,  
     79        self.assertNotEqual(self.qi.isProductInstalled(PRODUCT_NAME), True, 
    6180            '%s is already installed' % PRODUCT_NAME) 
    6281        self.assert_(not TOOL_ID in self.portal.objectIds()) 
     
    6988        self.assert_(not self.portal.hasProperty(CAPTCHA_KEY)) 
    7089 
     90 
    7191def test_suite(): 
    7292    suite = unittest.TestSuite() 
Note: See TracChangeset for help on using the changeset viewer.