

@requests_mock.mock()
def test_download_context(self, m):
    'Verify context (ie token) is passed to swift on download.'
    self.config(swift_store_multi_tenant=True)
    store = Store(self.conf)
    store.configure()
    uri = 'swift+http://127.0.0.1/glance_123/123'
    loc = location.get_location_from_uri(uri, conf=self.conf)
    m.get('http://127.0.0.1/glance_123/123', headers={
        'Content-Length': '0',
    })
    store.get(loc, context=self.ctx)
    self.assertEqual(b'0123', m.last_request.headers['X-Auth-Token'])

dataset/ETHPy150Open openstack/glance_store/glance_store/tests/unit/test_swift_store.py TestMultiTenantStoreContext.test_download_context/original