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

def setUp(self):

    super(TestManageExistingSnapshot, self).setUp()
    ctx = context.RequestContext('fake', 'fake', auth_token=True)
    self.volume = fake_volume.fake_volume_obj(ctx, **{'provider_id': fake.PROVIDER_ID})
    self.snapshot = fake_snapshot.fake_snapshot_obj(ctx, **{'provider_id': fake.PROVIDER2_ID})
    self.snapshot2 = fake_snapshot.fake_snapshot_obj(ctx, **{'provider_id': fake.PROVIDER3_ID})
    self.snapshot.volume = self.snapshot2.volume = self.volume
    self.snapshot['volume_type_id'] = fake.VOLUME_TYPE_ID
    self.snapshot2['volume_type_id'] = fake.VOLUME_TYPE_ID
    self.snapshot_attached = fake_snapshot.fake_snapshot_obj(ctx, **{'provider_id': fake.PROVIDER3_ID})
    self.HTTPS_MOCK_RESPONSES = {self.RESPONSE_MODE.Valid: {('instances/Volume::' + self.volume['provider_id']): mocks.MockHTTPSResponse({'id': fake.PROVIDER_ID, 'sizeInKb': 8388608, 'mappedSdcInfo': None, 'ancestorVolumeId': None}, 200), ('instances/Volume::' + self.snapshot['provider_id']): mocks.MockHTTPSResponse({'id': fake.PROVIDER2_ID, 'sizeInKb': 8000000, 'mappedSdcInfo': None, 'ancestorVolumeId': fake.PROVIDER_ID}, 200), ('instances/Volume::' + self.snapshot2['provider_id']): mocks.MockHTTPSResponse({'id': fake.PROVIDER3_ID, 'sizeInKb': 8388608, 'mappedSdcInfo': None, 'ancestorVolumeId': fake.PROVIDER2_ID}, 200)}, self.RESPONSE_MODE.BadStatus: {('instances/Volume::' + self.snapshot['provider_id']): mocks.MockHTTPSResponse({'errorCode': 401, 'message': 'BadStatus    Volume    Test'}, 401), ('instances/Volume::' + self.snapshot2['provider_id']): mocks.MockHTTPSResponse({'id': fake.PROVIDER3_ID, 'sizeInKb': 8388608, 'ancestorVolumeId': fake.PROVIDER2_ID}, 200), ('instances/Volume::' + self.snapshot_attached['provider_id']): mocks.MockHTTPSResponse({'id': fake.PROVIDER3_ID, 'sizeInKb': 8388608, 'mappedSdcInfo': 'Mapped', 'ancestorVolumeId': fake.PROVIDER_ID}, 200)}}
