'Initialise variables and mock functions.'

def setUp(self):

    super(CreateSnapshotTestCase, self).setUp()
    self.snapshot = fake_snapshot.fake_snapshot_obj(self.ctx, **{'volume': self.volume})
    self.mock_object(db.sqlalchemy.api, 'volume_get', self.get_fake_volume)
    mock.patch.object(self.requester, 'snapshotCreate', self.snapshot_request).start()
    mock.patch.object(self.requester, 'snapshotDetail', self.snapshot_detail_request).start()
    snapshot_detail_response = {'status': 0, 'snapshotInfoResult': {'snapshotId': 1234, 'description': 'a    description', 'createTime': '', 'expireTime': '', 'isDeleted': False, 'status': 0}}
    snap_success = copy.deepcopy(snapshot_detail_response)
    snap_pending = copy.deepcopy(snapshot_detail_response)
    snap_fail = copy.deepcopy(snapshot_detail_response)
    snap_response_fail = copy.deepcopy(snapshot_detail_response)
    snap_success['snapshotInfoResult']['status'] = self.DETAIL_OPTIONS['success']
    snap_pending['snapshotInfoResult']['status'] = self.DETAIL_OPTIONS['pending']
    snap_fail['snapshotInfoResult']['status'] = self.DETAIL_OPTIONS['failure']
    snap_response_fail['status'] = 1
    self.FAKE_RESPONSE['snapshot_detail'] = {'success': snap_success, 'fail': snap_fail, 'pending': snap_pending, 'request_fail': snap_response_fail}
    self.response = self.FAKE_RESPONSE['standard']['success']
    self.response['result'] = 1234
    self.response_detail = self.FAKE_RESPONSE['snapshot_detail']['success']
    self.test_pending = False
    self.test_pending_count = 0
