Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Modify lodaer global test to use populated dunders" #34676

Merged
merged 1 commit into from
Jul 14, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 9 additions & 19 deletions tests/integration/loader/globals.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import salt.loader
import inspect
import yaml
import copy

# Import 3rd-party libs
import salt.ext.six as six
Expand All @@ -34,15 +33,6 @@ class LoaderGlobalsTest(integration.ModuleCase):

This is intended as a shorter term way of testing these so we don't break the loader
'''

def setUp(self):
# Poor man's classSetUp (not supported in 2.6)
if not hasattr(self, 'minion_mods'):
self.opts = dict(copy.deepcopy(self.master_opts))
self.opts['grains'] = salt.loader.grains(self.opts)
self.utils = salt.loader.utils(self.opts)
self.minion_mods = salt.loader.minion_mods(self.opts, utils=self.utils)

def _verify_globals(self, mod_dict):
'''
Verify that the globals listed in the doc string (from the test) are in these modules
Expand Down Expand Up @@ -74,7 +64,7 @@ def test_auth(self):
- __salt__
- __context__
'''
self._verify_globals(salt.loader.auth(self.opts))
self._verify_globals(salt.loader.auth(self.master_opts))

def test_runners(self):
'''
Expand All @@ -85,7 +75,7 @@ def test_runners(self):
- __grains__
- __context__
'''
self._verify_globals(salt.loader.runner(self.opts))
self._verify_globals(salt.loader.runner(self.master_opts))

def test_returners(self):
'''
Expand All @@ -96,7 +86,7 @@ def test_returners(self):
- __grains__
- __context__
'''
self._verify_globals(salt.loader.returners(self.opts, {}))
self._verify_globals(salt.loader.returners(self.master_opts, {}))

def test_pillars(self):
'''
Expand All @@ -107,13 +97,13 @@ def test_pillars(self):
- __grains__
- __context__
'''
self._verify_globals(salt.loader.pillars(self.opts, {}))
self._verify_globals(salt.loader.pillars(self.master_opts, {}))

def test_tops(self):
'''
Test that tops have: []
'''
self._verify_globals(salt.loader.tops(self.opts))
self._verify_globals(salt.loader.tops(self.master_opts))

def test_outputters(self):
'''
Expand All @@ -123,13 +113,13 @@ def test_outputters(self):
- __grains__
- __context__
'''
self._verify_globals(salt.loader.outputters(self.opts))
self._verify_globals(salt.loader.outputters(self.master_opts))

def test_serializers(self):
'''
Test that serializers have: []
'''
self._verify_globals(salt.loader.serializers(self.opts))
self._verify_globals(salt.loader.serializers(self.master_opts))

def test_states(self):
'''
Expand All @@ -140,7 +130,7 @@ def test_states(self):
- __grains__
- __context__
'''
self._verify_globals(salt.loader.states(self.opts, self.minion_mods, {}))
self._verify_globals(salt.loader.states(self.master_opts, {}, {}))

def test_renderers(self):
'''
Expand All @@ -151,7 +141,7 @@ def test_renderers(self):
- __opts__ # Minion configuration options
- __context__ # Context dict shared amongst all modules of the same type
'''
self._verify_globals(salt.loader.render(self.opts, {}))
self._verify_globals(salt.loader.render(self.master_opts, {}))


if __name__ == '__main__':
Expand Down