2016-07-25 04:32:02 +00:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
'''
|
2016-07-26 23:04:30 +00:00
|
|
|
:codeauthor: :email:`{{full_name}} <{{email}}>`
|
2016-07-25 04:32:02 +00:00
|
|
|
'''
|
|
|
|
|
|
|
|
# Import Python Libs
|
|
|
|
from __future__ import absolute_import
|
|
|
|
|
|
|
|
# Import Salt Testing Libs
|
|
|
|
from salttesting import skipIf
|
|
|
|
from tests.unit import ModuleTestCase, hasDependency
|
|
|
|
from salttesting.mock import (
|
|
|
|
patch,
|
|
|
|
NO_MOCK,
|
|
|
|
NO_MOCK_REASON
|
|
|
|
)
|
|
|
|
from salttesting.helpers import ensure_in_syspath
|
2016-07-26 23:04:30 +00:00
|
|
|
from salt.modules import {{module_name}}
|
2016-07-25 04:32:02 +00:00
|
|
|
|
|
|
|
ensure_in_syspath('../../')
|
|
|
|
|
2016-07-26 23:04:30 +00:00
|
|
|
SERVICE_NAME = '{{module_name}}'
|
2016-07-28 03:42:36 +00:00
|
|
|
{{module_name}}.__salt__ = {}
|
2016-07-25 04:32:02 +00:00
|
|
|
|
|
|
|
|
|
|
|
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
2016-07-26 23:04:30 +00:00
|
|
|
class {{module_name|capitalize}}TestCase(ModuleTestCase):
|
2016-07-25 04:32:02 +00:00
|
|
|
def setUp(self):
|
|
|
|
# Optionally, tell the tests that you have a module installed into sys.modules
|
|
|
|
# hasDependency('library_name')
|
|
|
|
|
|
|
|
def get_config(service):
|
|
|
|
# generator for the configuration of the tests
|
|
|
|
return {}
|
|
|
|
|
|
|
|
self.setup_loader()
|
2016-07-26 23:04:30 +00:00
|
|
|
self.loader.set_result({{module_name}}, 'config.option', get_config)
|
2016-07-25 04:32:02 +00:00
|
|
|
|
|
|
|
def test_behaviour(self):
|
|
|
|
# Test inherent behaviours
|
|
|
|
pass
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
from unit import run_tests
|
2016-07-26 23:04:30 +00:00
|
|
|
run_tests({{module_name|capitalize}}TestCase)
|
2016-07-25 04:32:02 +00:00
|
|
|
|