MCPcopy Create free account
hub / github.com/saltstack/salt / test_modules

Function test_modules

tests/pytests/unit/modules/test_apache.py:51–66  ·  view source on GitHub ↗

Test if return list of static and shared modules

()

Source from the content-addressed store, hash-verified

49
50
51def test_modules():
52 """
53 Test if return list of static and shared modules
54 """
55 with patch("salt.modules.apache._detect_os", MagicMock(return_value="apachectl")):
56 mock = MagicMock(
57 return_value=(
58 "unixd_module (static)\n "
59 " access_compat_module (shared)"
60 )
61 )
62 with patch.dict(apache.__salt__, {"cmd.run": mock}):
63 assert apache.modules() == {
64 "shared": ["access_compat_module"],
65 "static": ["unixd_module"],
66 }
67
68
69# 'servermods' function tests: 1

Callers

nothing calls this directly

Calls 2

modulesMethod · 0.80
patchFunction · 0.50

Tested by

no test coverage detected