Debian Codegraph @

ansible_collections/dellemc/unity/tests/unit/plugins/module_utils/mock_sdk_response.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 SDKResponse for Unit tests for Unity modules"""
6
7 from __future__ import (absolute_import, division, print_function)
8
9 __metaclass__ = type
10
11
12 class MockSDKObject:
13 def __init__(self, data):
14 self.skip_list = ['skip_list']
15 for key, value in data.items():
16 setattr(self, key, value)
17
18 def add_to_skip_list(self, key):
19 self.skip_list.append(key)
20
21 def _get_properties(self):
22 data = {}
23 for attr, value in self.__dict__.items():
24 if attr not in self.skip_list:
25 data[attr] = value
26 return data
27
28 def get_id(self):
29 return "res_0"
30
31 def name(self):
32 return "res_0"