diff options
| author | Zuul <zuul@review.opendev.org> | 2026-01-13 10:07:55 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2026-01-13 10:07:55 +0000 |
| commit | c3d03c0b4f1079a3b42e947b750c4e0193769adc (patch) | |
| tree | a5718ecadb93bacf35ec5835b9d2b523201e1f19 /tests | |
| parent | c8ea844b2b31cfc0446b6174e6b033a4036b9750 (diff) | |
| parent | effd154e04a56203296a46fcce0b1919ddd029fb (diff) | |
| download | kolla-ansible-c3d03c0b4f1079a3b42e947b750c4e0193769adc.tar.gz kolla-ansible-c3d03c0b4f1079a3b42e947b750c4e0193769adc.zip | |
Merge "kolla_toolbox: Add support for deprecation warnings"
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test_kolla_toolbox.py | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/tests/test_kolla_toolbox.py b/tests/test_kolla_toolbox.py index 9dca821cc..e170964db 100644 --- a/tests/test_kolla_toolbox.py +++ b/tests/test_kolla_toolbox.py @@ -263,6 +263,53 @@ class TestKollaToolboxMethods(TestKollaToolboxModule): self.assertIn('Ansible JSON output has unexpected format', error.result['msg']) + def test_process_container_output_deprecation(self): + container_output_deprecation = "[DEPRECATION WARNING] Some deprecation" + container_output_json = { + 'custom_stats': {}, + 'global_custom_stats': {}, + 'plays': [ + { + 'tasks': [ + { + 'hosts': { + 'localhost': { + '_ansible_no_log': False, + 'action': 'ping', + 'changed': False, + 'invocation': { + 'module_args': { + 'data': 'pong' + } + }, + 'ping': 'pong' + } + }, + } + ] + } + ], + } + container_encoded_json = json.dumps(container_output_json) + container_output = (str(container_output_deprecation) + + str(container_encoded_json)).encode('utf-8') + + expected_output = { + 'action': 'ping', + 'changed': False, + 'invocation': { + 'module_args': { + 'data': 'pong' + } + }, + 'ping': 'pong' + } + generated_module_output = self.fake_ktbw._process_container_output( + container_output) + + self.assertNotIn('_ansible_no_log', generated_module_output) + self.assertEqual(expected_output, generated_module_output) + def test_process_container_output_success(self): container_output_json = { 'custom_stats': {}, |
