From 802f1ec7cb662b364c7a10577f392ad166082a3b Mon Sep 17 00:00:00 2001 From: Maximilien Cuony Date: Wed, 3 May 2023 10:55:02 +0200 Subject: [PATCH] tgt_type vs expr_form: fix tests --- pepper/libpepper.py | 5 +---- tests/integration/test_local.py | 7 ++++--- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/pepper/libpepper.py b/pepper/libpepper.py index 205b101..a232e3d 100644 --- a/pepper/libpepper.py +++ b/pepper/libpepper.py @@ -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 diff --git a/tests/integration/test_local.py b/tests/integration/test_local.py index 1db97c1..31d7538 100644 --- a/tests/integration/test_local.py +++ b/tests/integration/test_local.py @@ -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