'Initialise variables and mock functions.'

def setUp(self):

    super(CreateVolumeFromSnapshotTestCase, self).setUp()
    self.snapshot = fake_snapshot.fake_snapshot_obj(self.ctx, **{'volume': self.volume})
    mock.patch.object(self.requester, 'restoreFromSnapshot', self.restore_request).start()
    mock.patch.object(self.requester, 'restoreDetail', self.restore_detail_request).start()
    mock.patch.object(self.requester, 'volumeDetailByName', self.volume_detail_request).start()
    restore_detail_response = {'status': 0, 'restoreInfoResult': {'restoreId': 1234, 'startTime': '', 'statusPercent': '', 'volumeName': 'aVolumeName', 'snapshotId': 1234, 'status': 0}}
    self.volume_detail_response = {'status': 0, 'volumeInfoResult': {'volumeId': 1234567}}
    rest_success = copy.deepcopy(restore_detail_response)
    rest_pending = copy.deepcopy(restore_detail_response)
    rest_fail = copy.deepcopy(restore_detail_response)
    rest_response_fail = copy.deepcopy(restore_detail_response)
    rest_success['restoreInfoResult']['status'] = self.DETAIL_OPTIONS['success']
    rest_pending['restoreInfoResult']['status'] = self.DETAIL_OPTIONS['pending']
    rest_fail['restoreInfoResult']['status'] = self.DETAIL_OPTIONS['failure']
    rest_response_fail['status'] = 1
    self.FAKE_RESPONSE['restore_detail'] = {'success': rest_success, 'fail': rest_fail, 'pending': rest_pending, 'request_fail': rest_response_fail}
    self.response = self.FAKE_RESPONSE['standard']['success']
    self.response['result'] = '1234'
    self.response_detail = self.FAKE_RESPONSE['restore_detail']['success']
    self.test_pending = False
    self.test_pending_count = 0
