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

def setUp(self):

    super(TestCreateClonedVolume, self).setUp()
    ctx = context.RequestContext('fake', 'fake', auth_token=True)
    self.src_volume = fake_volume.fake_volume_obj(ctx, **{'provider_id': fake.PROVIDER_ID})
    self.src_volume_name_2x_enc = urllib.parse.quote(urllib.parse.quote(self.driver._id_to_base64(self.src_volume.id)))
    self.new_volume_extras = {'volumeIdList': ['cloned'], 'snapshotGroupId': 'cloned_snapshot'}
    self.new_volume = fake_volume.fake_volume_obj(ctx, **self.new_volume_extras)
    self.new_volume_name_2x_enc = urllib.parse.quote(urllib.parse.quote(self.driver._id_to_base64(self.new_volume.id)))
    self.HTTPS_MOCK_RESPONSES = {self.RESPONSE_MODE.Valid: {('types/Volume/instances/getByName::' + self.src_volume_name_2x_enc): self.src_volume.id, 'instances/System/action/snapshotVolumes': '{}'.format(json.dumps(self.new_volume_extras))}, self.RESPONSE_MODE.BadStatus: {'instances/System/action/snapshotVolumes': self.BAD_STATUS_RESPONSE, ('types/Volume/instances/getByName::' + self.src_volume['provider_id']): self.BAD_STATUS_RESPONSE}, self.RESPONSE_MODE.Invalid: {('types/Volume/instances/getByName::' + self.src_volume_name_2x_enc): None, 'instances/System/action/snapshotVolumes': mocks.MockHTTPSResponse({'errorCode': 400, 'message': 'Invalid    Volume    Snapshot    Test'}, 400)}}
