style: ruff format test_git_gate.py

This commit is contained in:
AIOSAI
2026-05-16 12:45:27 -07:00
parent f538517aa3
commit cfcec4596e
+6 -6
View File
@@ -353,11 +353,11 @@ class TestBypassDetection:
@pytest.mark.parametrize(
"cmd",
[
f'{_PY3} -c "import subprocess; subprocess.run([\'git\',\'commit\'])"',
f'{_PY3} -c "import os; os.system(\'git push\')"',
f'{_PY3} -c "from subprocess import Popen; Popen([\'gh\',\'pr\',\'create\'])"',
f'{_PY3} -c "from os import popen; popen(\'git merge\')"',
f'{_PY3} -c "from os import system; system(\'git push\')"',
f"{_PY3} -c \"import subprocess; subprocess.run(['git','commit'])\"",
f"{_PY3} -c \"import os; os.system('git push')\"",
f"{_PY3} -c \"from subprocess import Popen; Popen(['gh','pr','create'])\"",
f"{_PY3} -c \"from os import popen; popen('git merge')\"",
f"{_PY3} -c \"from os import system; system('git push')\"",
],
)
def test_blocks_subprocess_bypass(self, cmd):
@@ -418,7 +418,7 @@ class TestBypassDetection:
def test_allows_subprocess_no_git(self):
"""Subprocess calls without git/gh are allowed."""
assert self._run(f'{_PY3} -c "import subprocess; subprocess.run([\'ls\'])"') == 0
assert self._run(f"{_PY3} -c \"import subprocess; subprocess.run(['ls'])\"") == 0
def test_allows_read_only_full_path(self):
"""Read-only git via full path is allowed."""