Debian Codegraph @

ansible_collections/dellemc/unity/tests/unit/plugins/module_utils/mock_filesystem_api.py

raw symbols SCIP
1 # Copyright: (c) 2022, Dell Technologies
2
3 # Apache License version 2.0 (see MODULE-LICENSE or http: //www.apache.org/licenses/LICENSE-2.0.txt)
4
5 """Mock Api response for Unit tests of FileSystem module on Unity"""
6
7 from __future__ import (absolute_import, division, print_function)
8
9 __metaclass__ = type
10
11 from ansible_collections.dellemc.unity.tests.unit.plugins.module_utils.mock_sdk_response \
12 import MockSDKObject
13
14
15 class MockFileSystemApi:
16 @staticmethod
17 def get_file_system_response():
18 filesystem_response = {"UnityFileSystem": {
19 "access_policy": "AccessPolicyEnum.NATIVE",
20 "cifs_notify_on_change_dir_depth": 512,
21 "data_reduction_percent": 0,
22 "data_reduction_ratio": 1.0,
23 "data_reduction_size_saved": 0,
24 "description": "",
25 "existed": True,
26 "size_total": 5,
27 "folder_rename_policy": "FSRenamePolicyEnum.SMB_RENAME_FORBIDDEN",
28 "id": "fs_208",
29 "replication_type": "Remote"}}
30 filesystem_response['storage_resource'] = MockSDKObject({'replication_type': None})
31 return filesystem_response
32
33 @staticmethod
34 def get_replication_params(is_valid=True):
35 rpo = 60
36 if not is_valid:
37 rpo = 2
38 return {'replication_params': {
39 'replication_name': None,
40 'new_replication_name': None,
41 'replication_mode': 'asynchronous',
42 'replication_type': 'local',
43 'rpo': rpo,
44 'remote_system': None,
45 'destination_pool_name': 'pool_test_name_1',
46 'destination_pool_id': None},
47 'replication_state': 'enable',
48 'state': 'present'
49 }
50 else:
51 return {'replication_params': {
52 'replication_name': None,
53 'replication_mode': 'asynchronous',
54 'new_replication_name': None,
55 'replication_type': 'remote',
56 'rpo': rpo,
57 'remote_system': {
58 'remote_system_host': '1.1.1.1',
59 'remote_system_verifycert': False,
60 'remote_system_username': 'username',
61 'remote_system_password': 'password',
62 'remote_system_port': 1
63 },
64 'destination_pool_name': 'pool_test_name_1',
65 'destination_pool_id': None},
66 'replication_state': 'enable',
67 'state': 'present'
68 }