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

def setUp(self):

    super(TestGroups, self).setUp()
    self.ctx = context.RequestContext('fake', 'fake', auth_token=True)
    self.fake_grp_snap = {'id': 'group_snap_id', 'name': 'test_group_snapshot', 'group_id': fake.GROUP_ID, 'status': fields.GroupSnapshotStatus.AVAILABLE}
    self.group = fake_group.fake_group_obj(self.ctx, **{'id': fake.GROUP_ID})
    fake_volume1 = fake_volume.fake_volume_obj(self.ctx, **{'id': fake.VOLUME_ID, 'provider_id': fake.PROVIDER_ID})
    fake_volume2 = fake_volume.fake_volume_obj(self.ctx, **{'id': fake.VOLUME2_ID, 'provider_id': fake.PROVIDER2_ID})
    fake_volume3 = fake_volume.fake_volume_obj(self.ctx, **{'id': fake.VOLUME3_ID, 'provider_id': fake.PROVIDER3_ID})
    fake_volume4 = fake_volume.fake_volume_obj(self.ctx, **{'id': fake.VOLUME4_ID, 'provider_id': fake.PROVIDER4_ID})
    self.volumes = [fake_volume1, fake_volume2]
    self.volumes2 = [fake_volume3, fake_volume4]
    fake_snapshot1 = fake_snapshot.fake_snapshot_obj(self.ctx, **{'id': fake.SNAPSHOT_ID, 'volume_id': fake.VOLUME_ID, 'volume': fake_volume1})
    fake_snapshot2 = fake_snapshot.fake_snapshot_obj(self.ctx, **{'id': fake.SNAPSHOT2_ID, 'volume_id': fake.VOLUME2_ID, 'volume': fake_volume2})
    self.snapshots = [fake_snapshot1, fake_snapshot2]
    self.snapshot_reply = json.dumps({'volumeIdList': ['sid1', 'sid2'], 'snapshotGroupId': 'sgid1'})
    self.HTTPS_MOCK_RESPONSES = {self.RESPONSE_MODE.Valid: {'instances/Volume::{}/action/removeVolume'.format(fake_volume1['provider_id']): fake_volume1['provider_id'], 'instances/Volume::{}/action/removeVolume'.format(fake_volume2['provider_id']): fake_volume2['provider_id'], 'instances/Volume::{}/action/removeMappedSdc'.format(fake_volume1['provider_id']): fake_volume1['provider_id'], 'instances/Volume::{}/action/removeMappedSdc'.format(fake_volume2['provider_id']): fake_volume2['provider_id'], 'instances/System/action/snapshotVolumes': self.snapshot_reply}, self.RESPONSE_MODE.BadStatus: {'instances/Volume::{}/action/removeVolume'.format(fake_volume1['provider_id']): mocks.MockHTTPSResponse({'errorCode': 401, 'message': 'BadStatus    Volume    Test'}, 401), 'instances/Volume::{}/action/removeVolume'.format(fake_volume2['provider_id']): mocks.MockHTTPSResponse({'errorCode': 401, 'message': 'BadStatus    Volume    Test'}, 401), 'instances/System/action/snapshotVolumes': self.BAD_STATUS_RESPONSE}}
