Changeset 3600 in products


Ignore:
Timestamp:
Oct 24, 2012 3:05:59 PM (7 years ago)
Author:
vmaksymiv
Message:

PPP fixes

Location:
quintagroup.captcha.core/trunk/quintagroup/captcha/core
Files:
5 edited

Legend:

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

    r3144 r3600  
    3737 
    3838        self.assertTrue(self.layerInSkins(LAYER_STATIC_CAPTCHAS), 
    39             "No '%s' skin layer in some skins" % LAYER_STATIC_CAPTCHAS) 
     39                        "No '%s' skin layer in some skins" % 
     40                        LAYER_STATIC_CAPTCHAS) 
    4041 
    4142    def test_dynamicOn(self): 
     
    4445 
    4546        self.assertTrue(self.layerInSkins(LAYER_DYNAMIC_CAPTCHAS), 
    46             "No '%s' skin layer in some skins" % LAYER_DYNAMIC_CAPTCHAS) 
     47                        "No '%s' skin layer in some skins" % 
     48                        LAYER_DYNAMIC_CAPTCHAS) 
    4749 
    4850    def test_imageSize(self): 
    4951        expect = 35 
    5052        self.publish(self.save_url + '&image_size=%s' % expect, 
    51              self.basic_auth) 
     53                     self.basic_auth) 
    5254 
    5355        imsize = self.capprops.getProperty("image_size", 0) 
    54         self.assertTrue(imsize == expect, '"image_size" property ' \ 
    55             'contains: "%s", must: "%s"' % (imsize, expect)) 
     56        self.assertTrue(imsize == expect, '"image_size" property ' 
     57                        'contains: "%s", must: "%s"' % (imsize, expect)) 
    5658 
    5759    def test_background(self): 
    5860        prop, expect = "background", "test-color" 
    5961        self.publish(self.save_url + '&%s=%s' % (prop, expect), 
    60              self.basic_auth) 
     62                     self.basic_auth) 
    6163 
    6264        fact = self.capprops.getProperty(prop, "") 
    63         self.assertTrue(fact == expect, '"%s" property ' \ 
    64             'contains: "%s", must: "%s"' % (prop, fact, expect)) 
     65        self.assertTrue(fact == expect, '"%s" property ' 
     66                        'contains: "%s", must: "%s"' % (prop, fact, expect)) 
    6567 
    6668    def test_fontColor(self): 
    6769        prop, expect = "font_color", "test-font-color" 
    6870        self.publish(self.save_url + '&%s=%s' % (prop, expect), 
    69              self.basic_auth) 
     71                     self.basic_auth) 
    7072 
    7173        fact = self.capprops.getProperty(prop, "") 
    72         self.assertTrue(fact == expect, '"%s" property ' \ 
    73             'contains: "%s", must: "%s"' % (prop, fact, expect)) 
     74        self.assertTrue(fact == expect, '"%s" property ' 
     75                        'contains: "%s", must: "%s"' % (prop, fact, expect)) 
    7476 
    7577    def test_period(self): 
    7678        prop, expect = "period", 22.3 
    7779        self.publish(self.save_url + '&%s=%s' % (prop, expect), 
    78              self.basic_auth) 
     80                     self.basic_auth) 
    7981 
    8082        fact = self.capprops.getProperty(prop, 0) 
    81         self.assertTrue(fact == expect, '"%s" property ' \ 
    82             'contains: "%s", must: "%s"' % (prop, fact, expect)) 
     83        self.assertTrue(fact == expect, '"%s" property ' 
     84                        'contains: "%s", must: "%s"' % (prop, fact, expect)) 
    8385 
    8486    def test_amplitude(self): 
    8587        prop, expect = "amplitude", 11.2 
    8688        self.publish(self.save_url + '&%s=%s' % (prop, expect), 
    87              self.basic_auth) 
     89                     self.basic_auth) 
    8890 
    8991        fact = self.capprops.getProperty(prop, 0) 
    90         self.assertTrue(fact == expect, '"%s" property ' \ 
    91             'contains: "%s", must: "%s"' % (prop, fact, expect)) 
     92        self.assertTrue(fact == expect, '"%s" property ' 
     93                        'contains: "%s", must: "%s"' % (prop, fact, expect)) 
    9294 
    9395    def test_random(self): 
     
    9698 
    9799        fact = self.capprops.getProperty(prop, None) 
    98         self.assertTrue(fact == expect, '"%s" property ' \ 
    99             'contains: "%s", must: "%s"' % (prop, fact, expect)) 
     100        self.assertTrue(fact == expect, '"%s" property ' 
     101                        'contains: "%s", must: "%s"' % (prop, fact, expect)) 
    100102 
    101103 
     
    118120        form = re.match(reg_expr, self.view, re.I | re.S) 
    119121        self.assertNotEqual(form, None, 
    120             "No 'Plone Captchas Setup' form present on the configlet view") 
     122                            "No 'Plone Captchas Setup' form present on the configlet view") 
    121123        self.assertNotEqual(self.matchinput('form\.button\.form_submit'), None, 
    122             "No submit button on the form") 
     124                            "No submit button on the form") 
    123125        self.assertNotEqual(self.matchinput('static_captchas'), None, 
    124             "No static/dynamic radio button present on the configlet") 
     126                            "No static/dynamic radio button present on the configlet") 
    125127 
    126128    def test_dynamic(self): 
     
    129131        for param in params: 
    130132            self.assertNotEqual(self.matchinput(param), None, 
    131                 "'%s' form element absence on the configlet form" % param) 
     133                                "'%s' form element absence on the configlet form" % param) 
    132134 
    133135 
  • quintagroup.captcha.core/trunk/quintagroup/captcha/core/tests/testDynamic.py

    r3144 r3600  
    4444    def testPILImageFont(self): 
    4545        if not DYNAMIC_WORKABLE: 
    46             self.fail("You can not use Dynamic Captchas, only Static one " \ 
    47                 "unless install PIL with _imagingft C module into python, " \ 
    48                 "that is used for the current Zope instance.") 
     46            self.fail("You can not use Dynamic Captchas, only Static one " 
     47                      "unless install PIL with _imagingft C module into " 
     48                      "python, that is used for the current Zope instance.") 
    4949 
    5050 
     
    8787 
    8888        img_ctype = img_html.getHeader('content-type') 
    89         self.assertTrue(img_ctype == 'image/jpeg', "Wrong content type for " \ 
    90             "generated image: %s, must be 'image/jpeg'" % img_ctype) 
    91         self.assertTrue(img_html.status == 200, "Wrong response status: " \ 
    92             "'%s', must be '200'" % img_html.status) 
     89        self.assertTrue(img_ctype == 'image/jpeg', 
     90                        "Wrong content type for generated image: %s, " 
     91                        "must be 'image/jpeg'" % img_ctype) 
     92        self.assertTrue(img_html.status == 200, "Wrong response status: " 
     93                        "'%s', must be '200'" % img_html.status) 
    9394 
    9495 
  • quintagroup.captcha.core/trunk/quintagroup/captcha/core/tests/testInstallation.py

    r3144 r3600  
    2828        pp = getToolByName(self.portal, 'portal_properties') 
    2929        self.assert_(not PROPERTY_SHEET in pp.objectIds(), 
    30             'Property sheet found after uninstallation') 
     30                     'Property sheet found after uninstallation') 
    3131 
    3232    def testConfigletInstall(self): 
     
    8383        self.qi.uninstallProducts([PRODUCT_NAME]) 
    8484        self.assertNotEqual(self.qi.isProductInstalled(PRODUCT_NAME), True, 
    85             '%s is already installed' % PRODUCT_NAME) 
     85                            '%s is already installed' % PRODUCT_NAME) 
    8686        self.assert_(not TOOL_ID in self.portal.objectIds()) 
    8787 
  • quintagroup.captcha.core/trunk/quintagroup/captcha/core/tests/testStatic.py

    r3144 r3600  
    8383        # set up a dummy state object 
    8484        self.dummycs = ControllerState(id='prefs_captchas_setup_form', 
    85             context=self.portal, button='submit', status='success', 
    86             errors={}, ext_action=None,) 
     85                                       context=self.portal, button='submit', 
     86                                       status='success', errors={}, 
     87                                       ext_action=None,) 
    8788 
    8889    def testGoodData(self): 
  • quintagroup.captcha.core/trunk/quintagroup/captcha/core/utils.py

    r3217 r3600  
    1414from quintagroup.captcha.core.data import basic_english 
    1515#import quintagroup.captcha.core configuration values 
    16 from quintagroup.captcha.core.config import (DEFAULT_IMAGE_SIZE, DEFAULT_BG, 
    17     DEFAULT_FONT_COLOR, DEFAULT_DISTORTION, CAPTCHAS_COUNT) 
     16from quintagroup.captcha.core.config import ( 
     17    DEFAULT_IMAGE_SIZE, DEFAULT_BG, DEFAULT_FONT_COLOR, DEFAULT_DISTORTION, 
     18    CAPTCHAS_COUNT) 
    1819 
    1920try: 
     
    119120                 xRows[j + 1][i + 1], yRows[j + 1][i + 1], 
    120121                 xRows[j][i + 1], yRows[j][i + 1]), 
    121                 )) 
     122            )) 
    122123 
    123124    img = image.transform(image.size, Image.MESH, mesh, Image.BILINEAR) 
Note: See TracChangeset for help on using the changeset viewer.