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 767b67f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tests/integration/test_local.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
# -*- coding: utf-8 -*-

import warnings

def test_local(pepper_client, session_minion_id):
assert pepper_client.local('*', 'test.ping')['return'][0][session_minion_id] is True


def test_local_with_tgt_type(pepper_client, session_minion_id):
warnings.warn(UserWarning(str(pepper_client.local('*', 'test.ping', tgt_type='list')['return'])))
warnings.warn(UserWarning(str(pepper_client.local(session_minion_id, 'test.ping', tgt_type='list')['return'])))
assert pepper_client.local('*', 'test.ping', tgt_type='list')['return'][0][session_minion_id] is False
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):
warnings.warn(UserWarning(str(pepper_client.local('*', 'test.ping', expr_form='list')['return'][0])))
warnings.warn(UserWarning(str(pepper_client.local(session_minion_id, 'test.ping', expr_form='list')['return'])))
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
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 767b67f

Please sign in to comment.