Skip to content

Commit

Permalink
tgt_type vs expr_form: fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
the-glu committed May 3, 2023
1 parent 12780bb commit 802f1ec
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
5 changes: 1 addition & 4 deletions pepper/libpepper.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,11 +330,8 @@ def local(self, tgt, fun, arg=None, kwarg=None, tgt_type='glob',
low['tgt_type'] = tgt_type

if expr_form:

logger.warning('expr_form argument is deprecated in local function, please use tgt_type instead')

if not tgt_type:
low['tgt_type'] = expr_form
low['tgt_type'] = expr_form

if timeout:
low['timeout'] = timeout
Expand Down
7 changes: 4 additions & 3 deletions tests/integration/test_local.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ def test_local(pepper_client, session_minion_id):


def test_local_with_tgt_type(pepper_client, session_minion_id):
assert pepper_client.local('*', 'test.ping', tgt_type='list')['return'][0][session_minion_id] is False
assert session_minion_id not in pepper_client.local('*', 'test.ping', tgt_type='list')['return'][0]
assert pepper_client.local(session_minion_id, 'test.ping', tgt_type='list')['return'][0][session_minion_id] is True


def test_local_with_deprecated_expr_form(pepper_client, session_minion_id):
assert pepper_client.local('*', 'test.ping', expr_form='list')['return'][0][session_minion_id] is False
assert pepper_client.local(session_minion_id, 'test.ping', expr_form='list')['return'][0][session_minion_id] is True
assert session_minion_id not in pepper_client.local('*', 'test.ping', expr_form='list')['return'][0]
r = pepper_client.local(session_minion_id, 'test.ping', expr_form='list')['return'][0][session_minion_id]
assert r is True

0 comments on commit 802f1ec

Please sign in to comment.