mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-30 06:11:26 -07:00
Move _handle_no_log_values() out of basic.py (#48628)
* Rename method and make private * Use is_iterable, combine transformations * Remove unused return_values from network modules * Improve docstrings in new functions * Add new PASS_VAR * Add unit tests for list_no_log_values * Fix unit tests for Python 2.6
This commit is contained in:
parent
a7cee49913
commit
aba4bed803
22 changed files with 176 additions and 66 deletions
|
@ -8,7 +8,8 @@ __metaclass__ = type
|
|||
|
||||
from units.compat import unittest
|
||||
|
||||
from ansible.module_utils.basic import return_values, remove_values
|
||||
from ansible.module_utils.basic import remove_values
|
||||
from ansible.module_utils.common.parameters import _return_datastructure_name
|
||||
|
||||
|
||||
class TestReturnValues(unittest.TestCase):
|
||||
|
@ -40,12 +41,12 @@ class TestReturnValues(unittest.TestCase):
|
|||
('Toshio くらとみ', frozenset(['Toshio くらとみ'])),
|
||||
)
|
||||
|
||||
def test_return_values(self):
|
||||
def test_return_datastructure_name(self):
|
||||
for data, expected in self.dataset:
|
||||
self.assertEquals(frozenset(return_values(data)), expected)
|
||||
self.assertEquals(frozenset(_return_datastructure_name(data)), expected)
|
||||
|
||||
def test_unknown_type(self):
|
||||
self.assertRaises(TypeError, frozenset, return_values(object()))
|
||||
self.assertRaises(TypeError, frozenset, _return_datastructure_name(object()))
|
||||
|
||||
|
||||
class TestRemoveValues(unittest.TestCase):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue