mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 01:18:58 +00:00
bb0ed1a3a7
Defined "integration.run_tests()" function which can be used to execute a particular integration test case. Existing bolerplate code in modules and states tests is replaced with following lines: if __name__ == '__main__': from integration import run_tests run_tests(TestCaseName) Typical usecase could look like this: python integration/modules/pip.py --no-clean -vv
28 lines
665 B
Python
28 lines
665 B
Python
import integration
|
|
|
|
|
|
class SysModuleTest(integration.ModuleCase):
|
|
'''
|
|
Validate the sys module
|
|
'''
|
|
def test_list_functions(self):
|
|
'''
|
|
sys.list_functions
|
|
'''
|
|
funcs = self.run_function('sys.list_functions')
|
|
self.assertTrue('hosts.list_hosts' in funcs)
|
|
self.assertTrue('pkg.install' in funcs)
|
|
|
|
def test_list_modules(self):
|
|
'''
|
|
sys.list_moduels
|
|
'''
|
|
mods = self.run_function('sys.list_modules')
|
|
self.assertTrue('hosts' in mods)
|
|
self.assertTrue('pkg' in mods)
|
|
|
|
|
|
if __name__ == '__main__':
|
|
from integration import run_tests
|
|
run_tests(SysModuleTest)
|