def setUp(self):
     super(TestGlanceSwiftTempURL, self).setUp()
     client = stubs.StubGlanceClient()
     self.context = context.RequestContext()
     self.service = service.Service(client, 2, self.context)
     self.config(swift_temp_url_key='correcthorsebatterystaple',
                 group='glance')
     self.config(swift_endpoint_url='https://swift.example.com',
                 group='glance')
     self.config(swift_account='AUTH_a422b2-91f3-2f46-74b7-d7c9e8958f5d30',
                 group='glance')
     self.config(swift_api_version='v1', group='glance')
     self.config(swift_container='glance', group='glance')
     self.config(swift_temp_url_duration=1200, group='glance')
     self.config()
     self.fake_image = {'id': '757274c4-2856-4bd2-bb20-9a4a231e187b'}
    def setUp(self):
        super(TestGlanceImageService, self).setUp()
        client = stubs.StubGlanceClient()
        self.context = context.RequestContext(auth_token=True)
        self.context.user_id = 'fake'
        self.context.project_id = 'fake'
        self.service = service.Service(client, 1, self.context)

        self.config(glance_host='localhost', group='glance')
        try:
            self.config(auth_strategy='keystone', group='glance')
        except Exception:
            opts = [
                cfg.StrOpt('auth_strategy', default='keystone'),
            ]
            CONF.register_opts(opts)

        return