Merge patrol delete tests and remove pycache artifacts
This commit is contained in:
@@ -185,6 +185,32 @@ def test_wait_until_client_ready_polls_until_available(monkeypatch):
|
||||
assert sleeps == [base.CLIENT_READY_INTERVAL, base.CLIENT_READY_INTERVAL]
|
||||
|
||||
|
||||
def test_ziniao_webdriver_tail_redacts_password(monkeypatch, tmp_path):
|
||||
appdata = tmp_path / "AppData" / "Roaming"
|
||||
log_dir = appdata / "ziniaobrowser" / "instances" / "userdata1" / "logs" / "client"
|
||||
log_dir.mkdir(parents=True)
|
||||
log_file = log_dir / "webdriver.20260501.log"
|
||||
log_file.write_text(
|
||||
'[error] {"action":"updateCore","username":"u","password":"secret"}\n',
|
||||
encoding="utf-8",
|
||||
)
|
||||
messages = []
|
||||
|
||||
monkeypatch.setenv("APPDATA", str(appdata))
|
||||
monkeypatch.setattr(base.time, "strftime", lambda fmt: "20260501")
|
||||
sink_id = base.logger.add(messages.append, level="ERROR", format="{message}")
|
||||
|
||||
try:
|
||||
base.ZiniaoDriver({})._log_ziniao_webdriver_tail()
|
||||
finally:
|
||||
base.logger.remove(sink_id)
|
||||
|
||||
output = "\n".join(messages)
|
||||
assert "webdriver.20260501.log" in output
|
||||
assert '"password":"***"' in output
|
||||
assert "secret" not in output
|
||||
|
||||
|
||||
def test_close_store_success_uses_current_store(monkeypatch):
|
||||
payloads = []
|
||||
|
||||
|
||||
Reference in New Issue
Block a user