Пример #1
0
 def setUp(self):
     super(TestTankImageService, self).setUp()
     self.stubs = stubout.StubOutForTesting()
     fakes.stub_out_compute_api_snapshot(self.stubs)
     client = tank_stubs.StubTankClient()
     self.service = tank.TankImageService(client=client)
     self.context = context.RequestContext('fake', 'fake', auth_token=True)
     self.service.delete_all()
Пример #2
0
 def setUp(self):
     super(TestTankImageService, self).setUp()
     self.stubs = stubout.StubOutForTesting()
     fakes.stub_out_compute_api_snapshot(self.stubs)
     client = tank_stubs.StubTankClient()
     self.service = tank.TankImageService(client=client)
     self.context = context.RequestContext('fake', 'fake', auth_token=True)
     self.service.delete_all()
Пример #3
0
    def setUp(self):
        self.maxDiff = None
        super(ServerActionsControllerTest, self).setUp()

        self.stubs = stubout.StubOutForTesting()
        fakes.stub_out_auth(self.stubs)
        self.stubs.Set(engine.db, 'instance_get', return_server_by_id)
        self.stubs.Set(engine.db, 'instance_get_by_uuid', return_server_by_uuid)
        self.stubs.Set(engine.db, 'instance_update', instance_update)

        fakes.stub_out_tank(self.stubs)
        fakes.stub_out_nw_api(self.stubs)
        fakes.stub_out_rate_limiting(self.stubs)
        self.snapshot = fakes.stub_out_compute_api_snapshot(self.stubs)
        service_class = 'engine.image.tank.TankImageService'
        self.service = utils.import_object(service_class)
        self.context = context.RequestContext(1, None)
        self.service.delete_all()
        self.sent_to_tank = {}
        fakes.stub_out_tank_add_image(self.stubs, self.sent_to_tank)
        self.flags(allow_instance_snapshots=True)
        self.uuid = FAKE_UUID
        self.url = '/v2/fake/servers/%s/action' % self.uuid

        self.controller = servers.Controller()