cli2 4.0.3__tar.gz → 4.0.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {cli2-4.0.3/cli2.egg-info → cli2-4.0.4}/PKG-INFO +1 -1
- {cli2-4.0.3 → cli2-4.0.4}/cli2/client.py +2 -0
- {cli2-4.0.3 → cli2-4.0.4/cli2.egg-info}/PKG-INFO +1 -1
- {cli2-4.0.3 → cli2-4.0.4}/setup.py +1 -1
- {cli2-4.0.3 → cli2-4.0.4}/tests/test_client.py +30 -0
- {cli2-4.0.3 → cli2-4.0.4}/MANIFEST.in +0 -0
- {cli2-4.0.3 → cli2-4.0.4}/README.rst +0 -0
- {cli2-4.0.3 → cli2-4.0.4}/classifiers.txt +0 -0
- {cli2-4.0.3 → cli2-4.0.4}/cli2/__init__.py +0 -0
- {cli2-4.0.3 → cli2-4.0.4}/cli2/ansible/__init__.py +0 -0
- {cli2-4.0.3 → cli2-4.0.4}/cli2/ansible/action.py +0 -0
- {cli2-4.0.3 → cli2-4.0.4}/cli2/ansible/playbook.py +0 -0
- {cli2-4.0.3 → cli2-4.0.4}/cli2/ansible/pytest.py +0 -0
- {cli2-4.0.3 → cli2-4.0.4}/cli2/asyncio.py +0 -0
- {cli2-4.0.3 → cli2-4.0.4}/cli2/cli.py +0 -0
- {cli2-4.0.3 → cli2-4.0.4}/cli2/cli2.py +0 -0
- {cli2-4.0.3 → cli2-4.0.4}/cli2/colors.py +0 -0
- {cli2-4.0.3 → cli2-4.0.4}/cli2/configuration.py +0 -0
- {cli2-4.0.3 → cli2-4.0.4}/cli2/decorators.py +0 -0
- {cli2-4.0.3 → cli2-4.0.4}/cli2/display.py +0 -0
- {cli2-4.0.3 → cli2-4.0.4}/cli2/examples/__init__.py +0 -0
- {cli2-4.0.3 → cli2-4.0.4}/cli2/examples/client.py +0 -0
- {cli2-4.0.3 → cli2-4.0.4}/cli2/examples/conf.py +0 -0
- {cli2-4.0.3 → cli2-4.0.4}/cli2/examples/example.py +0 -0
- {cli2-4.0.3 → cli2-4.0.4}/cli2/examples/example_obj.py +0 -0
- {cli2-4.0.3 → cli2-4.0.4}/cli2/examples/nesting.py +0 -0
- {cli2-4.0.3 → cli2-4.0.4}/cli2/examples/obj.py +0 -0
- {cli2-4.0.3 → cli2-4.0.4}/cli2/examples/obj2.py +0 -0
- {cli2-4.0.3 → cli2-4.0.4}/cli2/examples/test.py +0 -0
- {cli2-4.0.3 → cli2-4.0.4}/cli2/lock.py +0 -0
- {cli2-4.0.3 → cli2-4.0.4}/cli2/log.py +0 -0
- {cli2-4.0.3 → cli2-4.0.4}/cli2/node.py +0 -0
- {cli2-4.0.3 → cli2-4.0.4}/cli2/sphinx.py +0 -0
- {cli2-4.0.3 → cli2-4.0.4}/cli2/table.py +0 -0
- {cli2-4.0.3 → cli2-4.0.4}/cli2/test.py +0 -0
- {cli2-4.0.3 → cli2-4.0.4}/cli2.egg-info/SOURCES.txt +0 -0
- {cli2-4.0.3 → cli2-4.0.4}/cli2.egg-info/dependency_links.txt +0 -0
- {cli2-4.0.3 → cli2-4.0.4}/cli2.egg-info/entry_points.txt +0 -0
- {cli2-4.0.3 → cli2-4.0.4}/cli2.egg-info/requires.txt +0 -0
- {cli2-4.0.3 → cli2-4.0.4}/cli2.egg-info/top_level.txt +0 -0
- {cli2-4.0.3 → cli2-4.0.4}/setup.cfg +0 -0
- {cli2-4.0.3 → cli2-4.0.4}/tests/test_ansible.py +0 -0
- {cli2-4.0.3 → cli2-4.0.4}/tests/test_cli.py +0 -0
- {cli2-4.0.3 → cli2-4.0.4}/tests/test_command.py +0 -0
- {cli2-4.0.3 → cli2-4.0.4}/tests/test_configuration.py +0 -0
- {cli2-4.0.3 → cli2-4.0.4}/tests/test_decorators.py +0 -0
- {cli2-4.0.3 → cli2-4.0.4}/tests/test_display.py +0 -0
- {cli2-4.0.3 → cli2-4.0.4}/tests/test_entry_point.py +0 -0
- {cli2-4.0.3 → cli2-4.0.4}/tests/test_group.py +0 -0
- {cli2-4.0.3 → cli2-4.0.4}/tests/test_inject.py +0 -0
- {cli2-4.0.3 → cli2-4.0.4}/tests/test_lock.py +0 -0
- {cli2-4.0.3 → cli2-4.0.4}/tests/test_node.py +0 -0
- {cli2-4.0.3 → cli2-4.0.4}/tests/test_restful.py +0 -0
- {cli2-4.0.3 → cli2-4.0.4}/tests/test_table.py +0 -0
|
@@ -1565,6 +1565,8 @@ class Client(metaclass=ClientMetaclass):
|
|
|
1565
1565
|
data[key] = '***MASKED***'
|
|
1566
1566
|
if isinstance(value, dict):
|
|
1567
1567
|
data[key] = self.mask_data(value, mask)
|
|
1568
|
+
if isinstance(value, list):
|
|
1569
|
+
data[key] = [self.mask_data(item, mask) for item in value]
|
|
1568
1570
|
return data
|
|
1569
1571
|
|
|
1570
1572
|
return data
|
|
@@ -854,6 +854,36 @@ def test_datetime_default_fmt(client_class):
|
|
|
854
854
|
assert model.data['dt'] == str_dt
|
|
855
855
|
|
|
856
856
|
|
|
857
|
+
@pytest.mark.asyncio
|
|
858
|
+
async def test_mask_recursive(client_class):
|
|
859
|
+
client = client_class(mask=['scrt', 'password'])
|
|
860
|
+
client.client.send = mock.AsyncMock()
|
|
861
|
+
|
|
862
|
+
client.logger = mock.Mock()
|
|
863
|
+
response = httpx.Response(
|
|
864
|
+
status_code=200,
|
|
865
|
+
content='{"pub": 1, "foo": [{"scrt": "pass"}]}',
|
|
866
|
+
)
|
|
867
|
+
data = [dict(foo=[dict(src='pass')])]
|
|
868
|
+
response.request = httpx.Request('POST', '/', json=data)
|
|
869
|
+
client.client.send.return_value = response
|
|
870
|
+
await client.post('/', json=data)
|
|
871
|
+
client.logger.bind.assert_called_once_with(
|
|
872
|
+
method='POST',
|
|
873
|
+
url='http://lol/',
|
|
874
|
+
)
|
|
875
|
+
log = client.logger.bind.return_value
|
|
876
|
+
log.debug.assert_called_once_with(
|
|
877
|
+
'request',
|
|
878
|
+
json=[{'foo': [{'src': 'pass'}]}],
|
|
879
|
+
)
|
|
880
|
+
log.info.assert_called_once_with(
|
|
881
|
+
'response',
|
|
882
|
+
status_code=200,
|
|
883
|
+
json={'pub': 1, 'foo': [{'scrt': '***MASKED***'}]},
|
|
884
|
+
)
|
|
885
|
+
|
|
886
|
+
|
|
857
887
|
@pytest.mark.asyncio
|
|
858
888
|
@pytest.mark.parametrize(
|
|
859
889
|
'key', ('json', 'data'),
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|