

def test_trans_id_header_extra_length_limit(self):
    app.assertEqual(self.logger.txn_id, None)

    def start_response(status, headers, exc_info=None):
        self.assertTrue(('X-Trans-Id' in (x[0] for x in headers)))
    app = catch_errors.CatchErrorMiddleware(FakeApp(), {
        'trans_id_suffix': '-fromconf',
    })
    req = Request.blank('/v1/a/c/o', headers={
        'X-Trans-Id-Extra': ('a' * 1000),
    })
    app(req.environ, start_response)
    self.assertTrue(self.logger.txn_id.endswith('-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'))

dataset/ETHPy150Open openstack/swift/test/unit/common/middleware/test_except.py TestCatchErrors.test_trans_id_header_extra_length_limit/VarMisuse@10/17 `self`->`app`