Debian Codegraph @

test/units/module_utils/test_connection.py

raw
1 # -*- coding: utf-8 -*-
2 # Copyright: (c) 2021, Matt Martz <[email protected]>
3 # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
4
5 from __future__ import annotations
6
7 from ansible.module_utils import connection
8
9 import pytest
10
11
12 def test_set_options_credential_exposure():
13 def send(data):
14 return '{'
15
16 c = connection.Connection(connection.__file__)
17 c.send = send
18 with pytest.raises(connection.ConnectionError) as excinfo:
19 c._exec_jsonrpc('set_options', become_pass='password')
20
21 assert 'password' not in str(excinfo.value)