mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Fix vt.Terminal failing test: test_log_sanitize
Fixes failing test added in a09b4f4450
We can't assume tests are run at debug level, so this ensures the test
passes regardless of what logging level is currently set by capturing
the output in caplog at DEBUG which stream_stdout/stream_stderr uses by
default.
Signed-off-by: Joe Groocock <jgroocock@cloudflare.com>
This commit is contained in:
parent
2fb207753e
commit
238a744bcb
1 changed files with 5 additions and 1 deletions
|
@ -1,3 +1,4 @@
|
|||
import logging
|
||||
import os
|
||||
import signal
|
||||
|
||||
|
@ -43,10 +44,13 @@ def test_log_sanitize(test_cmd, caplog):
|
|||
cmd,
|
||||
log_stdout=True,
|
||||
log_stderr=True,
|
||||
log_stdout_level="debug",
|
||||
log_stderr_level="debug",
|
||||
log_sanitize=password,
|
||||
stream_stdout=False,
|
||||
stream_stderr=False,
|
||||
)
|
||||
ret = term.recv()
|
||||
with caplog.at_level(logging.DEBUG):
|
||||
ret = term.recv()
|
||||
assert password not in caplog.text
|
||||
assert "******" in caplog.text
|
||||
|
|
Loading…
Add table
Reference in a new issue