

@patch('oslo.config.cfg')
def test_admin_token(self, cfg):
    req = MagicMock()
    req.headers = {
        'X-AUTH-TOKEN': 'ADMIN',
    }
    resp = MagicMock()
    cfg.CONF = {
        'DEFAULT': {
            'admin_token': 'ADMIN',
        },
    }
    admin_token(req, resp, {
        
    })
    self.assertTrue(req.env['is_admin'])
    req.headers = {
        'X-AUTH-TOKEN': 'ABC',
    }
    req.env = {
        
    }
    admin_token(self, resp, {
        
    })
    self.assertIsNone(req.env.get('is_admin'))

dataset/ETHPy150Open softlayer/jumpgate/tests/jumpgate-tests/common/hooks/test_hooks.py TestHookAdminToken.test_admin_token/VarMisuse@111/154 `req`->`self`