'Checks whether there\'s a regression.
This method is intentionally protected so that the test runner doesn\'t
detect any tests in base regression classes. ApiRegressionTestMetaclass
creates a public testForRegression method for generated regression
classes.'

def _testForRegression(self):

    self.maxDiff = 65536
    with open(self.output_file_name, 'rb') as fd:
        prev_data = json.load(fd)
    checks = prev_data[self.__class__.handler.__name__]
    relevant_checks = []
    for check in checks:
        if (check['test_class'] == self.__class__.__name__):
            relevant_checks.append(check)
    self.Run()
    self.assertTrue(self.checks)
    checks_str = json.dumps(self.checks, indent=2, sort_keys=True, separators=(',', ':    '))
    prev_checks_str = json.dumps(relevant_checks, indent=2, sort_keys=True, separators=(',', ':    '))
    self.assertMultiLineEqual(prev_checks_str, checks_str)
