Download Install Tutorial Docs FAQ Tools WikiLicense Team IRC Planet Involvement Shop Book

Changeset 1792

Show
Ignore:
Timestamp:
10/27/07 23:21:50
Author:
fumanchu
Message:

Use %r instead of %s and obj.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/cherrypy/test/webtest.py

    r1761 r1792  
    339339            if not self.status == status: 
    340340                if msg is None: 
    341                     msg = 'Status (%s) != %s' % (`self.status`, `status`
     341                    msg = 'Status (%r) != %r' % (self.status, status
    342342                self._handlewebError(msg) 
    343343        elif isinstance(status, int): 
     
    345345            if code != status: 
    346346                if msg is None: 
    347                     msg = 'Status (%s) != %s' % (`self.status`, `status`
     347                    msg = 'Status (%r) != %r' % (self.status, status
    348348                self._handlewebError(msg) 
    349349        else: 
     
    360360            if not match: 
    361361                if msg is None: 
    362                     msg = 'Status (%s) not in %s' % (`self.status`, `status`
     362                    msg = 'Status (%r) not in %r' % (self.status, status
    363363                self._handlewebError(msg) 
    364364     
     
    373373        if msg is None: 
    374374            if value is None: 
    375                 msg = '%s not in headers' % `key` 
     375                msg = '%r not in headers' % key 
    376376            else: 
    377                 msg = '%s:%s not in headers' % (`key`, `value`
     377                msg = '%r:%r not in headers' % (key, value
    378378        self._handlewebError(msg) 
    379379     
     
    384384        if matches: 
    385385            if msg is None: 
    386                 msg = '%s in headers' % `key` 
     386                msg = '%r in headers' % key 
    387387            self._handlewebError(msg) 
    388388     
     
    391391        if value != self.body: 
    392392            if msg is None: 
    393                 msg = 'expected body:\n%s\n\nactual body:\n%s' % (`value`, `self.body`
     393                msg = 'expected body:\n%r\n\nactual body:\n%r' % (value, self.body
    394394            self._handlewebError(msg) 
    395395     
     
    398398        if value not in self.body: 
    399399            if msg is None: 
    400                 msg = '%s not in body' % `value` 
     400                msg = '%r not in body' % value 
    401401            self._handlewebError(msg) 
    402402     
     
    405405        if value in self.body: 
    406406            if msg is None: 
    407                 msg = '%s found in body' % `value` 
     407                msg = '%r found in body' % value 
    408408            self._handlewebError(msg) 
    409409     
     
    412412        if re.search(pattern, self.body, flags) is None: 
    413413            if msg is None: 
    414                 msg = 'No match for %s in body' % `pattern` 
     414                msg = 'No match for %r in body' % pattern 
    415415            self._handlewebError(msg) 
    416416 

Hosted by WebFaction

Log in as guest/cpguest to create tickets