Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F53864770
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/_tests/salt_test_case.py b/_tests/salt_test_case.py
index baae1c3..9f2c7c2 100644
--- a/_tests/salt_test_case.py
+++ b/_tests/salt_test_case.py
@@ -1,29 +1,30 @@
from importlib.machinery import SourceFileLoader
import yaml
class SaltTestCase:
def initialize_mocks(self):
source = SourceFileLoader("dunder", "mocks/dunder.py").load_module()
self.pillar = source.dunder()
self.grains = source.dunder()
- def import_data_from_yaml(self, filename):
+ @staticmethod
+ def import_data_from_yaml(filename):
with open(filename, 'r') as fd:
return yaml.load(fd.read())
def mock_pillar(self, filename=None, target=None):
if not target:
target = self.instance
if filename:
self.pillar.data = self.import_data_from_yaml(filename)
target.__pillar__ = self.pillar
def mock_grains(self, target=None):
if not target:
target = self.instance
target.__grains__ = self.grains
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Wed, Oct 14, 20:50 (1 d, 13 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
4181875
Default Alt Text
(1 KB)
Attached To
Mode
rOPS Nasqueron Operations
Attached
Detach File
Event Timeline
Log In to Comment