mirror of
https://github.com/valitydev/salt.git
synced 2024-11-06 16:45:27 +00:00
Fix templates for the new test module naming scheme
This commit is contained in:
parent
8337a164ee
commit
2a76618b17
@ -29,7 +29,7 @@ Creates a new execution module within salt/modules/{{module_name}}.py
|
|||||||
module_unit
|
module_unit
|
||||||
^^^^^^^^^^^
|
^^^^^^^^^^^
|
||||||
|
|
||||||
Creates a new execution module unit test suite within tests/unit/modules/{{module_name}}_test.py
|
Creates a new execution module unit test suite within tests/unit/modules/test_{{module_name}}.py
|
||||||
|
|
||||||
state
|
state
|
||||||
^^^^^
|
^^^^^
|
||||||
@ -39,7 +39,7 @@ Creates a new state module within salt/states/{{module_name}}.py
|
|||||||
state_unit
|
state_unit
|
||||||
^^^^^^^^^^
|
^^^^^^^^^^
|
||||||
|
|
||||||
Creates a new state module unit test suite within tests/unit/states/{{module_name}}_test.py
|
Creates a new state module unit test suite within tests/unit/states/test_{{module_name}}.py
|
||||||
|
|
||||||
|
|
||||||
Adding templates
|
Adding templates
|
||||||
|
@ -14,10 +14,8 @@ from salttesting.mock import (
|
|||||||
NO_MOCK,
|
NO_MOCK,
|
||||||
NO_MOCK_REASON
|
NO_MOCK_REASON
|
||||||
)
|
)
|
||||||
from salttesting.helpers import ensure_in_syspath
|
|
||||||
from salt.modules import {{module_name}}
|
from salt.modules import {{module_name}}
|
||||||
|
|
||||||
ensure_in_syspath('../../')
|
|
||||||
|
|
||||||
SERVICE_NAME = '{{module_name}}'
|
SERVICE_NAME = '{{module_name}}'
|
||||||
{{module_name}}.__salt__ = {}
|
{{module_name}}.__salt__ = {}
|
||||||
@ -39,8 +37,3 @@ class {{module_name|capitalize}}TestCase(ModuleTestCase):
|
|||||||
def test_behaviour(self):
|
def test_behaviour(self):
|
||||||
# Test inherent behaviours
|
# Test inherent behaviours
|
||||||
pass
|
pass
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
from unit import run_tests
|
|
||||||
run_tests({{module_name|capitalize}}TestCase)
|
|
||||||
|
|
@ -14,11 +14,8 @@ from salttesting.mock import (
|
|||||||
NO_MOCK,
|
NO_MOCK,
|
||||||
NO_MOCK_REASON
|
NO_MOCK_REASON
|
||||||
)
|
)
|
||||||
from salttesting.helpers import ensure_in_syspath
|
|
||||||
from salt.states import {{module_name}}
|
from salt.states import {{module_name}}
|
||||||
|
|
||||||
ensure_in_syspath('../../')
|
|
||||||
|
|
||||||
SERVICE_NAME = '{{module_name}}'
|
SERVICE_NAME = '{{module_name}}'
|
||||||
{{module_name}}.__salt__ = {}
|
{{module_name}}.__salt__ = {}
|
||||||
|
|
||||||
@ -39,8 +36,3 @@ class {{module_name|capitalize}}TestCase(ModuleTestCase):
|
|||||||
def test_behaviour(self):
|
def test_behaviour(self):
|
||||||
# Test inherent behaviours
|
# Test inherent behaviours
|
||||||
pass
|
pass
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
from unit import run_tests
|
|
||||||
run_tests({{module_name|capitalize}}TestCase)
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user