diff --git a/src/saltext/freezer/modules/freezer_mod.py b/src/saltext/freezer/modules/freezer_mod.py deleted file mode 100644 index 9ac3d54..0000000 --- a/src/saltext/freezer/modules/freezer_mod.py +++ /dev/null @@ -1,27 +0,0 @@ -""" -Salt execution module -""" -import logging - -log = logging.getLogger(__name__) - -__virtualname__ = "freezer" - - -def __virtual__(): - # To force a module not to load return something like: - # return (False, "The freezer execution module is not implemented yet") - return __virtualname__ - - -def example_function(text): - """ - This example function should be replaced - - CLI Example: - - .. code-block:: bash - - salt '*' freezer.example_function text="foo bar" - """ - return __salt__["test.echo"](text) diff --git a/src/saltext/freezer/states/freezer_mod.py b/src/saltext/freezer/states/freezer_mod.py deleted file mode 100644 index 34eb63a..0000000 --- a/src/saltext/freezer/states/freezer_mod.py +++ /dev/null @@ -1,30 +0,0 @@ -""" -Salt state module -""" -import logging - -log = logging.getLogger(__name__) - -__virtualname__ = "freezer" - - -def __virtual__(): - # To force a module not to load return something like: - # return (False, "The freezer state module is not implemented yet") - - # Replace this with your own logic - if "freezer.example_function" not in __salt__: - return False, "The 'freezer' execution module is not available" - return __virtualname__ - - -def exampled(name): - """ - This example function should be replaced - """ - ret = {"name": name, "changes": {}, "result": False, "comment": ""} - value = __salt__["freezer.example_function"](name) - if value == name: - ret["result"] = True - ret["comment"] = f"The 'freezer.example_function' returned: '{value}'" - return ret diff --git a/tests/functional/modules/test_freezer.py b/tests/functional/modules/test_freezer.py deleted file mode 100644 index 31b581a..0000000 --- a/tests/functional/modules/test_freezer.py +++ /dev/null @@ -1,16 +0,0 @@ -import pytest - -pytestmark = [ - pytest.mark.requires_salt_modules("freezer.example_function"), -] - - -@pytest.fixture -def freezer(modules): - return modules.freezer - - -def test_replace_this_this_with_something_meaningful(freezer): - echo_str = "Echoed!" - res = freezer.example_function(echo_str) - assert res == echo_str diff --git a/tests/functional/states/test_freezer.py b/tests/functional/states/test_freezer.py deleted file mode 100644 index de46328..0000000 --- a/tests/functional/states/test_freezer.py +++ /dev/null @@ -1,18 +0,0 @@ -import pytest - -pytestmark = [ - pytest.mark.requires_salt_states("freezer.exampled"), -] - - -@pytest.fixture -def freezer(states): - return states.freezer - - -def test_replace_this_this_with_something_meaningful(freezer): - echo_str = "Echoed!" - ret = freezer.exampled(echo_str) - assert ret.result - assert not ret.changes - assert echo_str in ret.comment diff --git a/tests/integration/modules/test_freezer.py b/tests/integration/modules/test_freezer.py deleted file mode 100644 index 1d9567f..0000000 --- a/tests/integration/modules/test_freezer.py +++ /dev/null @@ -1,13 +0,0 @@ -import pytest - -pytestmark = [ - pytest.mark.requires_salt_modules("freezer.example_function"), -] - - -def test_replace_this_this_with_something_meaningful(salt_call_cli): - echo_str = "Echoed!" - ret = salt_call_cli.run("freezer.example_function", echo_str) - assert ret.exitcode == 0 - assert ret.json - assert ret.json == echo_str diff --git a/tests/unit/states/test_freezer.py b/tests/unit/states/test_freezer.py deleted file mode 100644 index 601e49f..0000000 --- a/tests/unit/states/test_freezer.py +++ /dev/null @@ -1,31 +0,0 @@ -import pytest -import salt.modules.test as testmod -import saltext.freezer.modules.freezer_mod as freezer_module -import saltext.freezer.states.freezer_mod as freezer_state - - -@pytest.fixture -def configure_loader_modules(): - return { - freezer_module: { - "__salt__": { - "test.echo": testmod.echo, - }, - }, - freezer_state: { - "__salt__": { - "freezer.example_function": freezer_module.example_function, - }, - }, - } - - -def test_replace_this_this_with_something_meaningful(): - echo_str = "Echoed!" - expected = { - "name": echo_str, - "changes": {}, - "result": True, - "comment": f"The 'freezer.example_function' returned: '{echo_str}'", - } - assert freezer_state.exampled(echo_str) == expected