def make_status_checker(nameprefix, status):
    class Checker(object):
        name = '{0}_{1}'.format(nameprefix, status)

        def __call__(self):
            return self

        def match(self, response):
            self._actual = response.status_code
            self._response_data = response.data
            return self._actual == status

        def message_for_failed_should(self):
            message = 'Expected the status code {0}, but got {1}.'.format(
                      status, self._actual
                      )
            if self._response_data:
                response = 'Response Data:\n"{0}"'.format(self._response_data)
                message = '\n'.join([message, response])
            return message

        def message_for_failed_should_not(self):
            return 'Expected the status code not to be {0}'.format(status)
    return Checker


# Make be_xxx matchers for all the status codes
Uses curses to print in the fanciest way possible.
dataset/ETHPy150Open obmarg/flask-should-dsl/flask_should_dsl/matchers.py/make_status_checker--crossover with--dataset/ETHPy150Open mozilla/app-validator/appvalidator/errorbundle/outputhandlers/shellcolors.py/OutputHandler.write