

def test_single_tenant_location(self):
    conf = copy.deepcopy(SWIFT_CONF)
    conf['swift_store_container'] = 'container'
    conf_file = 'glance-swift.conf'
    self.swift_config_file = self.copy_data_file(conf_file, self.test_dir)
    conf.update({
        'swift_store_config_file': self.swift_config_file,
    })
    conf['default_swift_reference'] = 'ref1'
    self.config(**conf)
    moves.reload_module(swift)
    store = swift.SingleTenantStore(self.conf)
    store.configure()
    location = store.create_location('image-id')
    self.assertEqual(conf.scheme, 'swift+https')
    self.assertEqual(location.swift_url, 'https://example.com')
    self.assertEqual(location.container, 'container')
    self.assertEqual(location.obj, 'image-id')
    self.assertEqual(location.user, 'tenant:user1')
    self.assertEqual(location.key, 'key1')

dataset/ETHPy150Open openstack/glance_store/glance_store/tests/unit/test_swift_store.py TestCreatingLocations.test_single_tenant_location/VarMisuse@113/170 `location`->`conf`