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:
Sam Doran 2019-03-04 17:02:44 -05:00 committed by GitHub
parent a7cee49913
commit aba4bed803
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
22 changed files with 176 additions and 66 deletions

View file

@ -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):