'Setup a test case environment.
Creates fake volume object and sets up the required API responses.'

def setUp(self):

    super(TestExtendVolume, self).setUp()
    ctx = context.RequestContext('fake', 'fake', auth_token=True)
    self.volume = fake_volume_obj(ctx, **{'id': fake.VOLUME_ID, 'provider_id': fake.PROVIDER_ID})
    self.volume_name_2x_enc = urllib.parse.quote(urllib.parse.quote(self.driver._id_to_base64(self.volume.id)))
    self.HTTPS_MOCK_RESPONSES = {self.RESPONSE_MODE.Valid: {('types/Volume/instances/getByName::' + self.volume_name_2x_enc): '"{}"'.format(self.volume.id), 'instances/Volume::{}/action/setVolumeSize'.format(self.volume.provider_id): mocks.MockHTTPSResponse({}, 200)}, self.RESPONSE_MODE.BadStatus: {('types/Volume/instances/getByName::' + self.volume_name_2x_enc): self.BAD_STATUS_RESPONSE, ('types/Volume/instances/getByName::' + self.volume_name_2x_enc): self.BAD_STATUS_RESPONSE, 'instances/Volume::{}/action/setVolumeSize'.format(self.volume.provider_id): self.BAD_STATUS_RESPONSE}, self.RESPONSE_MODE.Invalid: {('types/Volume/instances/getByName::' + self.volume_name_2x_enc): None, 'instances/Volume::{}/action/setVolumeSize'.format(self.volume.provider_id): mocks.MockHTTPSResponse({'errorCode': self.OLD_VOLUME_NOT_FOUND_ERROR, 'message': 'BadStatus    Volume    Test'}, 400)}}
