AlluraTest/alluratest/validation.py
def _validate(self, resp, method, val_params):
        """Perform validation on webapp response. This handles responses of
        various types and forms."""
        if resp.status_int != 200:
            return

        content = resp.body
        content_type = resp.headers['Content-Type']
        if content_type.startswith('text/html'):
            if val_params['validate_chunk']:
                if Config.instance().validation_enabled('html5'):
                    validate_html5_chunk(content)
            else:
                validate_page(resp)
        elif content_type.split(';', 1)[0] in ('text/plain', 'text/x-python', 'application/octet-stream'):
            pass
        elif content_type.startswith('application/json'):
            validate_json(content)
        elif content_type.startswith(('application/x-javascript', 'application/javascript', 'text/javascript')):
            validate_js(content)
        elif content_type.startswith('application/xml'):
            import feedparser
            d = feedparser.parse(content)
            assert d.bozo == 0, 'Non-wellformed feed'
        elif content_type.startswith('image/'):
            pass
        else:
            assert False, 'Unexpected output content type: ' + content_type
Perform validation on webapp response. This handles responses of
        various types and forms.
Perform validation on webapp response. This handles responses of
various types and forms.
Perform validation on webapp response . This handles responses of various types and forms .
def _validate(self, resp, method, val_params):
        if resp.status_int != 200:
            return
        content = resp.body
        content_type = resp.headers['Content-Type']
        if content_type.startswith('text/html'):
            if val_params['validate_chunk']:
                if Config.instance().validation_enabled('html5'):
                    validate_html5_chunk(content)
            else:
                validate_page(resp)
        elif content_type.split(';', 1)[0] in ('text/plain', 'text/x-python', 'application/octet-stream'):
            pass
        elif content_type.startswith('application/json'):
            validate_json(content)
        elif content_type.startswith(('application/x-javascript', 'application/javascript', 'text/javascript')):
            validate_js(content)
        elif content_type.startswith('application/xml'):
            import feedparser
            d = feedparser.parse(content)
            assert d.bozo == 0, 'Non-wellformed feed'
        elif content_type.startswith('image/'):
            pass
        else:
            assert False, 'Unexpected output content type: ' + content_type
def _validate ( self , resp , method , val_params ) : if resp . status_int != 200 : return content = resp . body content_type = resp . headers [ 'Content-Type' ] if content_type . startswith ( 'text/html' ) : if val_params [ 'validate_chunk' ] : if Config . instance ( ) . validation_enabled ( 'html5' ) : validate_html5_chunk ( content ) else : validate_page ( resp ) elif content_type . split ( ';' , 1 ) [ 0 ] in ( 'text/plain' , 'text/x-python' , 'application/octet-stream' ) : pass elif content_type . startswith ( 'application/json' ) : validate_json ( content ) elif content_type . startswith ( ( 'application/x-javascript' , 'application/javascript' , 'text/javascript' ) ) : validate_js ( content ) elif content_type . startswith ( 'application/xml' ) : import feedparser d = feedparser . parse ( content ) assert d . bozo == 0 , 'Non-wellformed feed' elif content_type . startswith ( 'image/' ) : pass else : assert False , 'Unexpected output content type: ' + content_type
Perform validation on webapp response.
Perform validation on webapp response .
"""Perform validation on webapp response. This handles responses of
        various types and forms."""
self
resp
method
val_params