mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
tests for server_id and get_master
This commit is contained in:
parent
48b182cf84
commit
489b3387be
1 changed files with 16 additions and 0 deletions
|
@ -3359,6 +3359,9 @@ def test_get_server_id():
|
|||
with patch.dict(core.__opts__, {"id": "otherid"}):
|
||||
assert core.get_server_id() != expected
|
||||
|
||||
with patch.object(salt.utils.platform, "is_proxy", MagicMock(return_value=True)):
|
||||
assert core.get_server_id() == {}
|
||||
|
||||
|
||||
def test_linux_cpudata_ppc64le():
|
||||
cpuinfo = """processor : 0
|
||||
|
@ -4014,3 +4017,16 @@ Graphics/Displays:
|
|||
with patch.dict(core.__salt__, {"cmd.run": MagicMock(side_effect=OSError)}):
|
||||
ret = core._osx_gpudata()
|
||||
assert ret == {"num_gpus": 0, "gpus": []}
|
||||
|
||||
|
||||
def test_get_master():
|
||||
"""
|
||||
test get_master
|
||||
"""
|
||||
ret = core.get_master()
|
||||
assert "master" in ret
|
||||
|
||||
with patch("salt.grains.core.__opts__", {"master": "test_master_id"}):
|
||||
ret = core.get_master()
|
||||
assert "master" in ret
|
||||
assert ret["master"] == "test_master_id"
|
||||
|
|
Loading…
Add table
Reference in a new issue