def setUp(self): super(ShellStdinHandlingTests, self).setUp() self.api = utils.FakeAPI(fixtures) self.gc = client.Client("http://fakeaddress.com") self.gc.images = glanceclient.v1.images.ImageManager(self.api) # Store real stdin, so it can be restored in tearDown. self.real_sys_stdin_fd = os.dup(0) # Replace stdin with a FD that points to /dev/null. dev_null = open('/dev/null') self.dev_null_fd = dev_null.fileno() os.dup2(dev_null.fileno(), 0) # Replace the image update function with a fake, # so that we can tell if the data field was set correctly. self.real_update_func = self.gc.images.update self.collected_args = [] self.gc.images.update = self._fake_update_func
def setUp(self): super(ImageMemberManagerTest, self).setUp() self.api = utils.FakeAPI(fixtures) self.mgr = glanceclient.v1.image_members.ImageMemberManager(self.api) self.image = glanceclient.v1.images.Image(self.api, {'id': '1'}, True)
def setUp(self): super(TestController, self).setUp() self.api = utils.FakeAPI(fixtures) self.schema_api = utils.FakeSchemaAPI(schema_fixtures) self.controller = tasks.Controller(self.api, self.schema_api)
def setUp(self): super(ImageTest, self).setUp() self.api = utils.FakeAPI(fixtures) self.mgr = images.ImageManager(self.api)
def setUp(self): super(TestController, self).setUp() self.api = utils.FakeAPI(fixtures) self.controller = images.Controller(self.api, FakeModel)
def setUp(self): super(TestPropertyController, self).setUp() self.api = utils.FakeAPI(data_fixtures) self.schema_api = utils.FakeSchemaAPI(schema_fixtures) self.controller = metadefs.PropertyController(self.api, self.schema_api)
def setUp(self): super(TestController, self).setUp() self.api = utils.FakeAPI(fixtures) self.controller = schemas.Controller(self.api)
def setUp(self): super(ImageManagerTest, self).setUp() self.api = utils.FakeAPI(fixtures) self.mgr = glanceclient.v1.images.ImageManager(self.api)
def setUp(self): super(TestResoureTypeController, self).setUp() self.api = utils.FakeAPI(data_fixtures) self.schema_api = utils.FakeSchemaAPI(schema_fixtures) self.controller = metadefs.ResourceTypeController( self.api, self.schema_api)
def setUp(self): super(TestController, self).setUp() self.api = utils.FakeAPI(data_fixtures) self.schema_api = utils.FakeSchemaAPI(schema_fixtures) self.controller = image_members.Controller(self.api, self.schema_api)