From 5026c447df4daa7e9d0e50d4a934d8843c7deb53 Mon Sep 17 00:00:00 2001 From: Bo Maryniuk Date: Wed, 21 Mar 2018 16:45:30 +0100 Subject: [PATCH] Add unit test for thin.gte call --- tests/unit/utils/test_thin.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/unit/utils/test_thin.py b/tests/unit/utils/test_thin.py index 2952872bd1..1841f04671 100644 --- a/tests/unit/utils/test_thin.py +++ b/tests/unit/utils/test_thin.py @@ -13,6 +13,7 @@ from tests.support.mock import ( import salt.exceptions from salt.utils import thin +from salt.utils import json import salt.utils.stringutils try: @@ -143,3 +144,13 @@ class SSHThinTestCase(TestCase): 'tornado': '/tornado/tornado.py', 'msgpack': 'msgpack.py'}}} assert cfg == thin.get_ext_tops(cfg) + + @patch('salt.utils.thin.sys.argv', [None, '{"foo": "bar"}']) + @patch('salt.utils.thin.get_tops', lambda **kw: kw) + def test_gte(self): + ''' + Test thin.gte external call for processing the info about tops per interpreter. + + :return: + ''' + assert json.loads(thin.gte()).get('foo') == 'bar'