Debian Codegraph @

ansible_collections/dellemc/unity/tests/unit/plugins/module_utils/mock_nasserver_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 NASServer module on Unity"""
6
7 from __future__ import (absolute_import, division, print_function)
8
9 __metaclass__ = type
10
11
12 class MockNASServerApi:
13 @staticmethod
14 def get_nas_server_response():
15 return ({"access_policy": "AccessPolicyEnum.NATIVE",
16 "cifs_notify_on_change_dir_depth": 512,
17 "data_reduction_percent": 0,
18 "data_reduction_ratio": 1.0,
19 "data_reduction_size_saved": 0,
20 "description": "",
21 "existed": True,
22 "size_total": 5,
23 "id": "nas0",
24 "name": "nas0",
25 "replication_type": "Remote"})
26
27 @staticmethod
28 def get_replication_params(is_valid=True):
29 rpo = 60
30 if not is_valid:
31 rpo = 2
32 return {'replication_params': {
33 'replication_name': None,
34 'new_replication_name': None,
35 'replication_type': 'local',
36 'replication_mode': 'asynchronous',
37 'rpo': rpo,
38 'remote_system': None,
39 'destination_nas_server_name': None,
40 'destination_pool_name': 'pool_test_name_1',
41 'destination_pool_id': None},
42 'replication_state': 'enable',
43 'state': 'present'
44 }
45 else:
46 return {'replication_params': {
47 'replication_name': None,
48 'replication_mode': 'asynchronous',
49 'new_replication_name': None,
50 'replication_type': 'remote',
51 'rpo': rpo,
52 'remote_system': {
53 'remote_system_host': '1.1.1.1',
54 'remote_system_verifycert': False,
55 'remote_system_username': 'username',
56 'remote_system_password': 'password',
57 'remote_system_port': 1
58 },
59 'destination_nas_server_name': None,
60 'destination_pool_name': 'pool_test_name_1',
61 'destination_pool_id': None},
62 'replication_state': 'enable',
63 'state': 'present'
64 }