MCPcopy
hub / github.com/saltstack/salt / test_prep_pub_nodegroup

Function test_prep_pub_nodegroup

tests/pytests/unit/client/test_init.py:204–231  ·  view source on GitHub ↗
(master_opts)

Source from the content-addressed store, hash-verified

202
203
204def test_prep_pub_nodegroup(master_opts):
205 master_opts["nodegroups"] = {
206 "group1": "L@spongebob,patrick",
207 "group2": "G@os:squidward",
208 "group3": "G@os:plankton and N@group1",
209 }
210 local_client = salt.client.get_local_client(mopts=master_opts)
211 result = local_client._prep_pub(
212 tgt="group1",
213 fun="test.ping",
214 arg="",
215 tgt_type="nodegroup",
216 ret="",
217 jid="123",
218 timeout=7,
219 )
220 expected = {
221 "arg": "",
222 "cmd": "publish",
223 "fun": "test.ping",
224 "jid": "123",
225 "key": "",
226 "ret": "",
227 "tgt": "L@spongebob,patrick",
228 "tgt_type": "compound",
229 "user": local_client.salt_user,
230 }
231 assert result == expected
232
233
234def test_prep_pub_compound(local_client):

Callers

nothing calls this directly

Calls 1

_prep_pubMethod · 0.45

Tested by

no test coverage detected