Ignore:
Timestamp:
Sep 11, 2012 7:30:25 AM (12 years ago)
Author:
ktarasz
Message:

fix pep8

File:
1 edited

Legend:

Unmodified
Added
Removed
  • quintagroup.seoptimizer/trunk/quintagroup/seoptimizer/tests/testInstallation.py

    r3140 r3547  
    1717PROPERTY_SHEET = 'seo_properties' 
    1818STOP_WORDS = ['a', 'an', 'amp', 'and', 'are', 'arial', 'as', 'at', 'be', 'but', 
    19     'by', 'can', 'com', 'do', 'font', 'for', 'from', 'gif', 'had', 'has', 
    20     'have', 'he', 'helvetica', 'her', 'his', 'how', 'href', 'i', 'if', 'in', 
    21     'is', 'it', 'javascript', 'jpg', 'made', 'net', 'of', 'on', 'or', 'org', 
    22     'our', 'sans', 'see', 'serif', 'she', 'that', 'the', 'this', 'to', 'us', 
    23     'we', 'with', 'you', 'your'] 
     19              'by', 'can', 'com', 'do', 'font', 'for', 'from', 'gif', 'had', 
     20              'has', 'have', 'he', 'helvetica', 'her', 'his', 'how', 'href', 
     21              'i', 'if', 'in', 'is', 'it', 'javascript', 'jpg', 'made', 'net', 
     22              'of', 'on', 'or', 'org', 'our', 'sans', 'see', 'serif', 'she', 
     23              'that', 'the', 'this', 'to', 'us', 'we', 'with', 'you', 'your'] 
    2424 
    2525PROPS = {'stop_words': STOP_WORDS, 
     
    7070        map_sheet = self.properties[PROPERTY_SHEET] 
    7171        for key, value in PROPS.items(): 
    72             self.failUnless(map_sheet.hasProperty(key) and \ 
     72            self.failUnless(map_sheet.hasProperty(key) and 
    7373                            list(map_sheet.getProperty(key)) == value) 
    7474 
    7575    def test_configlet_install(self): 
    7676        configTool = getToolByName(self.portal, 'portal_controlpanel', None) 
    77         self.assert_(PROJECT_NAME in [a.getId() for a in \ 
    78                                       configTool.listActions()], \ 
     77        self.assert_(PROJECT_NAME in [a.getId() for a in 
     78                                      configTool.listActions()], 
    7979                     'Configlet not found') 
    8080 
     
    8989        view = queryMultiAdapter((self.portal, request), name="plone") 
    9090        manager = queryMultiAdapter((self.portal['front-page'], request, view), 
    91                                      IViewletManager, name='plone.htmlhead') 
     91                                    IViewletManager, name='plone.htmlhead') 
    9292        for p in VIEWLETS: 
    93             self.assert_(manager.get(p) is not None, "Not registered '%s' " \ 
     93            self.assert_(manager.get(p) is not None, "Not registered '%s' " 
    9494                         "viewlet" % p) 
    9595 
     
    122122    def test_configlet_uninstall(self): 
    123123        self.assertNotEqual(self.qi.isProductInstalled(PROJECT_NAME), True, 
    124             'qSEOptimizer is already installed') 
     124                            'qSEOptimizer is already installed') 
    125125 
    126126        configTool = getToolByName(self.portal, 'portal_controlpanel', None) 
    127         self.assertEqual(PROJECT_NAME in [a.getId() for a in \ 
     127        self.assertEqual(PROJECT_NAME in [a.getId() for a in 
    128128                                          configTool.listActions()], False, 
    129129                         'Configlet found after uninstallation') 
     
    138138        for p in VIEWLETS: 
    139139            self.assertEqual(manager.get(p) is None, True, 
    140                 "'%s' viewlet present after uninstallation" % p) 
     140                             "'%s' viewlet present after uninstallation" % p) 
    141141 
    142142    def test_browserlayer_uninstall(self): 
     
    146146        from plone.browserlayer import utils 
    147147        self.assertEqual(IPloneSEOLayer in utils.registered_layers(), False, 
    148             "Still registered 'IPloneSEOLayer' browser layer") 
     148                         "Still registered 'IPloneSEOLayer' browser layer") 
    149149 
    150150    def test_action_uninstall(self): 
     
    152152        action_ids = [a.id for a in atool.listActions()] 
    153153        self.assertEqual("SEOProperties" in action_ids, False, 
    154                          "'SEOProperties' action not removed from " \ 
     154                         "'SEOProperties' action not removed from " 
    155155                         "portal_actions on uninstallation") 
    156156 
     
    178178        for type in SEO_CONTENT: 
    179179            self.assertEqual(self.types_tool.getTypeInfo(type).i18n_domain, 
    180                              'plone', "Not changed of %s content type's " \ 
     180                             'plone', "Not changed of %s content type's " 
    181181                             "domain to 'plone'" % type) 
    182182 
     
    191191        mto.sort() 
    192192        self.assertEqual(mto, expect_mto, 
    193                          "Not changed format metatags order list from \"" \ 
    194                          "metaname accessor\" to \"metaname\". %s != %s" \ 
     193                         "Not changed format metatags order list from \"" 
     194                         "metaname accessor\" to \"metaname\". %s != %s" 
    195195                         % (mto, expect_mto)) 
    196196 
     
    202202        mto.sort() 
    203203        self.assertEqual(mto, DEFAULT_METATAGS_ORDER, 
    204                          "Not added metatags order list with default values." \ 
     204                         "Not added metatags order list with default values." 
    205205                         "%s != %s" % (mto, DEFAULT_METATAGS_ORDER)) 
    206206 
     
    213213        for type in CONTENTTYPES_WITH_SEOACTION: 
    214214            self.types_tool.getTypeInfo(type).addAction( 
    215                                     id='seo_properties', 
    216                                     name='SEO Properties', 
    217                                     action=None, 
    218                                     condition=None, 
    219                                     permission=(u'Modify portal content',), 
    220                                     category='object', 
    221                                    ) 
     215                id='seo_properties', 
     216                name='SEO Properties', 
     217                action=None, 
     218                condition=None, 
     219                permission=(u'Modify portal content',), 
     220                category='object', 
     221            ) 
    222222            # Check presence seoaction in content type 
    223             seoaction = [act.id for act in \ 
    224                          self.types_tool.getTypeInfo(type).listActions() \ 
     223            seoaction = [act.id for act in 
     224                         self.types_tool.getTypeInfo(type).listActions() 
    225225                         if act.id == 'seo_properties'] 
    226226            self.assertEqual(bool(seoaction), True, 
    227                              "Not added seoaction to content type %s for " \ 
     227                             "Not added seoaction to content type %s for " 
    228228                             "testing" % type) 
    229229 
     
    232232        # Check presence seoaction in content type 
    233233        for type in CONTENTTYPES_WITH_SEOACTION: 
    234             seoaction = [act.id for act in \ 
    235                          self.types_tool.getTypeInfo(type).listActions() \ 
     234            seoaction = [act.id for act in 
     235                         self.types_tool.getTypeInfo(type).listActions() 
    236236                         if act.id == 'seo_properties'] 
    237237            self.assertEqual(bool(seoaction), False, 
    238                 "Not removed seoaction in content type %s" % type) 
     238                             "Not removed seoaction in content type %s" % type) 
    239239 
    240240        # Check added content type names in seo properties tool 
     
    243243        ctws.sort() 
    244244        self.assertEqual(ctws, CONTENTTYPES_WITH_SEOACTION, 
    245                          "Not added content type names in seo properties " \ 
    246                          "tool if content types have seoaction. %s != %s" \ 
     245                         "Not added content type names in seo properties " 
     246                         "tool if content types have seoaction. %s != %s" 
    247247                         % (ctws, CONTENTTYPES_WITH_SEOACTION)) 
    248248 
     
    259259            path = map(string.strip, string.split(path, ',')) 
    260260            self.assertEqual(layer in path, False, 
    261                              '%s layer found in %s after uninstallation' \ 
     261                             '%s layer found in %s after uninstallation' 
    262262                             % (layer, skin)) 
    263263 
     
    274274        value = doc.getProperty(PROPERTY_LINK) 
    275275        has_prop = bool(doc.hasProperty('qSEO_canonical')) 
    276         self.assertEqual(has_prop, False, "Property 'qSEO_canonical' is " \ 
     276        self.assertEqual(has_prop, False, "Property 'qSEO_canonical' is " 
    277277                         "not deleted.") 
    278         self.assertEqual(value == 'val', True, "Property not migrated from " \ 
     278        self.assertEqual(value == 'val', True, "Property not migrated from " 
    279279                         "'qSEO_canonical' to '%s'." % PROPERTY_LINK) 
    280280 
Note: See TracChangeset for help on using the changeset viewer.