Skip to content

Commit ce91328

Browse files
committed
Mock _execute_command instead of Popen.__new__
1 parent d6cd305 commit ce91328

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/utils/test_tools.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ def test_download_rizin_successfully(tmp_path):
188188
def test_fail_to_download_rizin_due_to_unavailable_network(tmp_path):
189189
target_path = tmp_path / "rizin"
190190

191-
with patch("subprocess.Popen.__new__") as mock:
191+
with patch("quark.utils.tools._execute_command") as mock:
192192
mock.side_effect = CalledProcessError(
193193
"1",
194194
"mock command",
@@ -202,7 +202,7 @@ def test_fail_to_download_rizin_due_to_unavailable_network(tmp_path):
202202
def test_fail_to_download_rizin_due_to_unknown_errors(tmp_path):
203203
target_path = tmp_path / "rizin"
204204

205-
with patch("subprocess.Popen.__new__") as mock:
205+
with patch("quark.utils.tools._execute_command") as mock:
206206
mock.side_effect = CalledProcessError("1", "mock command", stderr=b"")
207207

208208
assert not download_rizin(target_path)

0 commit comments

Comments
 (0)