'Set up the test case environment.
Defines the mock HTTPS responses for the REST API calls.'

def setUp(self):

    super(TestMisc, self).setUp()
    self.domain_name_enc = urllib.parse.quote(self.DOMAIN_NAME)
    self.pool_name_enc = urllib.parse.quote(self.POOL_NAME)
    self.ctx = context.RequestContext('fake', 'fake', auth_token=True)
    self.volume = fake_volume.fake_volume_obj(self.ctx, **{'name': 'vol1', 'provider_id': fake.PROVIDER_ID})
    self.new_volume = fake_volume.fake_volume_obj(self.ctx, **{'name': 'vol2', 'provider_id': fake.PROVIDER2_ID})
    self.HTTPS_MOCK_RESPONSES = {self.RESPONSE_MODE.Valid: {('types/Domain/instances/getByName::' + self.domain_name_enc): '"{}"'.format(self.DOMAIN_NAME).encode('ascii', 'ignore'), 'types/Pool/instances/getByName::{},{}'.format(self.DOMAIN_NAME, self.POOL_NAME): '"{}"'.format(self.POOL_NAME).encode('ascii', 'ignore'), 'types/StoragePool/instances/action/querySelectedStatistics': {'"{}"'.format(self.POOL_NAME): {'capacityAvailableForVolumeAllocationInKb': 5000000, 'capacityLimitInKb': 16000000, 'spareCapacityInKb': 6000000, 'thickCapacityInUseInKb': 266, 'thinCapacityAllocatedInKm': 0}}, 'instances/Volume::{}/action/setVolumeName'.format(self.volume['provider_id']): self.new_volume['provider_id'], 'instances/Volume::{}/action/setVolumeName'.format(self.new_volume['provider_id']): self.volume['provider_id'], 'version': '"{}"'.format('2.0.1'), 'instances/StoragePool::{}'.format('test_pool'): {'name': 'test_pool', 'protectionDomainId': 'test_domain'}, 'instances/ProtectionDomain::{}'.format('test_domain'): {'name': 'test_domain'}}, self.RESPONSE_MODE.BadStatus: {('types/Domain/instances/getByName::' + self.domain_name_enc): self.BAD_STATUS_RESPONSE, 'instances/Volume::{}/action/setVolumeName'.format(self.volume['provider_id']): mocks.MockHTTPSResponse({'message': 'Invalid    volume.', 'httpStatusCode': 400, 'errorCode': self.VOLUME_NOT_FOUND_ERROR}, 400)}, self.RESPONSE_MODE.Invalid: {('types/Domain/instances/getByName::' + self.domain_name_enc): None, 'instances/Volume::{}/action/setVolumeName'.format(self.volume['provider_id']): mocks.MockHTTPSResponse({'message': 'Invalid    volume.', 'httpStatusCode': 400, 'errorCode': 0}, 400)}}
