Skip to content

Commit

Permalink
Fix shutil tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Wout Feys committed Nov 15, 2024
1 parent c618ff2 commit d07ac6c
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions aikido_zen/sinks/tests/shutil_test.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import pytest
from unittest.mock import patch
import aikido_zen.sinks.builtins
import aikido_zen.sinks.shutil
import aikido_zen

aikido_zen.protect("daemon_disabled")


kind = "path_traversal"
Expand Down Expand Up @@ -57,7 +58,7 @@ def test_shutil_copymode():
op = "shutil.copymode"
args1 = ("Makefile",)
args2 = ("test2",)
assert len(mock_run_vulnerability_scan.call_args_list) == 2
assert len(mock_run_vulnerability_scan.call_args_list) == 3
call_1 = mock_run_vulnerability_scan.call_args_list[0]
call_2 = mock_run_vulnerability_scan.call_args_list[1]

Expand All @@ -76,7 +77,7 @@ def test_shutil_copystat():
op = "shutil.copystat"
args1 = ("Makefile",)
args2 = ("test2",)
assert len(mock_run_vulnerability_scan.call_args_list) == 2
assert len(mock_run_vulnerability_scan.call_args_list) == 3
call_1 = mock_run_vulnerability_scan.call_args_list[0]
call_2 = mock_run_vulnerability_scan.call_args_list[1]

Expand Down Expand Up @@ -115,7 +116,7 @@ def test_shutil_move():
op = "shutil.move"
args1 = ("test2",)
args2 = ("test3",)
assert len(mock_run_vulnerability_scan.call_args_list) == 2
assert len(mock_run_vulnerability_scan.call_args_list) == 4
call_1 = mock_run_vulnerability_scan.call_args_list[0]
call_2 = mock_run_vulnerability_scan.call_args_list[1]

Expand All @@ -134,7 +135,7 @@ def test_shutil_copy():
op = "builtins.open"
args1 = ("Makefile",)
args2 = ("test2",)
assert len(mock_run_vulnerability_scan.call_args_list) == 2
assert len(mock_run_vulnerability_scan.call_args_list) == 3
call_1 = mock_run_vulnerability_scan.call_args_list[0]
call_2 = mock_run_vulnerability_scan.call_args_list[1]

Expand All @@ -154,7 +155,7 @@ def test_shutil_copy2():
op = "builtins.open"
args1 = ("Makefile",)
args2 = ("test2",)
assert len(mock_run_vulnerability_scan.call_args_list) == 2
assert len(mock_run_vulnerability_scan.call_args_list) == 3
call_1 = mock_run_vulnerability_scan.call_args_list[0]
call_2 = mock_run_vulnerability_scan.call_args_list[1]

Expand Down

0 comments on commit d07ac6c

Please sign in to comment.