Skip to content

Commit

Permalink
Rename clamscan client script
Browse files Browse the repository at this point in the history
  • Loading branch information
sevein committed Sep 17, 2024
1 parent da9c499 commit 5e71df3
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/MCPClient/lib/archivematicaClientModules
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
assignfileuuids_v0.0 = assign_file_uuids
bindpid_v0.0 = bind_pid
removeunneededfiles_v0.0 = remove_unneeded_files
archivematicaclamscan_v0.0 = archivematica_clamscan
antivirus_v0.0 = antivirus
createevent_v0.0 = create_event
examinecontents_v0.0 = examine_contents
identifydspacefiles_v0.0 = identify_dspace_files
Expand Down
File renamed without changes.
10 changes: 5 additions & 5 deletions src/MCPServer/lib/assets/workflow.json
Original file line number Diff line number Diff line change
Expand Up @@ -2525,7 +2525,7 @@
"@manager": "linkTaskManagerFiles",
"@model": "StandardTaskConfig",
"arguments": "\"%fileUUID%\" \"%relativeLocation%\" \"%date%\"",
"execute": "archivematicaClamscan_v0.0",
"execute": "antivirus_v0.0",
"filter_subdir": "objects/submissionDocumentation",
"stderr_file": "%SIPLogsDirectory%clamAVScan.txt"
},
Expand Down Expand Up @@ -2556,7 +2556,7 @@
"@manager": "linkTaskManagerFiles",
"@model": "StandardTaskConfig",
"arguments": "\"%fileUUID%\" \"%relativeLocation%\" \"%date%\"",
"execute": "archivematicaClamscan_v0.0",
"execute": "antivirus_v0.0",
"stderr_file": "%SIPLogsDirectory%clamAVScan.txt"
},
"description": {
Expand Down Expand Up @@ -2885,7 +2885,7 @@
"@manager": "linkTaskManagerFiles",
"@model": "StandardTaskConfig",
"arguments": "\"%fileUUID%\" \"%relativeLocation%\" \"%date%\"",
"execute": "archivematicaClamscan_v0.0",
"execute": "antivirus_v0.0",
"stderr_file": "%SIPLogsDirectory%clamAVScan.txt"
},
"description": {
Expand Down Expand Up @@ -6624,7 +6624,7 @@
"@manager": "linkTaskManagerFiles",
"@model": "StandardTaskConfig",
"arguments": "\"%fileUUID%\" \"%relativeLocation%\" \"%date%\"",
"execute": "archivematicaClamscan_v0.0",
"execute": "antivirus_v0.0",
"filter_subdir": "objects/"
},
"description": {
Expand Down Expand Up @@ -7203,7 +7203,7 @@
"@manager": "linkTaskManagerFiles",
"@model": "StandardTaskConfig",
"arguments": "\"%fileUUID%\" \"%relativeLocation%\" \"%date%\"",
"execute": "archivematicaClamscan_v0.0",
"execute": "antivirus_v0.0",
"filter_subdir": "objects/metadata",
"stderr_file": "%SIPLogsDirectory%clamAVScan.txt"
},
Expand Down
14 changes: 7 additions & 7 deletions tests/MCPClient/test_antivirus.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
"""Tests for the archivematica_clamscan.py client script."""
"""Tests for the antivirus.py client script."""

from collections import OrderedDict
from collections import namedtuple
from unittest import mock

import pytest
from archivematica_clamscan import create_scanner
from archivematica_clamscan import scan_file
from antivirus import create_scanner
from antivirus import scan_file
from clamav_client.scanner import ClamdScanner
from clamav_client.scanner import ClamscanScanner
from clamav_client.scanner import Scanner
Expand Down Expand Up @@ -95,7 +95,7 @@ def setup_test_scan_file_mocks(
):
deps = namedtuple("deps", ["file_already_scanned", "file_get", "scanner"])(
file_already_scanned=mocker.patch(
"archivematica_clamscan.file_already_scanned",
"antivirus.file_already_scanned",
return_value=file_already_scanned,
),
file_get=mocker.patch(
Expand All @@ -104,7 +104,7 @@ def setup_test_scan_file_mocks(
scanner=ScannerMock(should_except=scanner_should_except, passed=scanner_passed),
)

mocker.patch("archivematica_clamscan.get_scanner", return_value=deps.scanner)
mocker.patch("antivirus.get_scanner", return_value=deps.scanner)

return deps

Expand Down Expand Up @@ -183,8 +183,8 @@ def test_scan_file(mocker, setup_kwargs, exit_code, queue_event_params, settings
ret = scan_file(event_queue, **dict(args))

# The integer returned by scan_file() is going to be used as the exit code
# of the archivematica_clamscan.py script which is important for the AM
# workflow in order to control what to do next.
# of the antivirus.py script which is important for the AM workflow in order
# to control what to do next.
assert exit_code == ret

# A side effect of scan_file() is to queue an event to be created in the
Expand Down

0 comments on commit 5e71df3

Please sign in to comment.