def validate(self):
        content_length_keys = 'Content-Length', 'content-length'
        for key in content_length_keys:
            got = self.adding_headers.get(
                key, self.forcing_headers.get(key, None))

            if got is None:
                continue

            try:
                igot = int(got)
            except (ValueError, __HOLE__):
                warnings.warn(
                    'HTTPretty got to register the Content-Length header '
                    'with "%r" which is not a number' % got)
                return

            if igot > self.body_length:
                raise HTTPrettyError(
                    'HTTPretty got inconsistent parameters. The header '
                    'Content-Length you registered expects size "%d" but '
                    'the body you registered for that has actually length '
                    '"%d".' % (
                        igot, self.body_length,
                    )
                )
dataset/ETHPy150Open gabrielfalcao/HTTPretty/httpretty/core.py/Entry.validate