ouroboros/tests/test_shell_write_indicator.py
Ouroboros 27827193db fix: distinguish urlopen from file writes
Co-authored-by: Ouroboros <311266734+ouroboros-agent@users.noreply.github.com>
2026-08-11 09:37:42 +03:00

18 lines
575 B
Python

"""Focused regressions for the coarse shell write-shape classifier."""
from ouroboros.tools.shell_guards import shell_has_write_indicator
def test_urlopen_is_not_mistaken_for_open_write_shape():
command = (
"python3 -c \"import urllib.request; "
"print(urllib.request.urlopen('https://example.com').status)\""
)
assert shell_has_write_indicator(command) is False
def test_builtin_open_write_shape_remains_detected():
command = "python3 -c \"open('result.txt', 'w').write('done')\""
assert shell_has_write_indicator(command) is True