11
11
mine = (stat .S_IREAD | stat .S_IWRITE )
12
12
other = stat .S_IROTH
13
13
execute = (stat .S_IEXEC | stat .S_IXOTH )
14
+ EICAR_SIG_NAME = "Win.Test.EICAR_HDB-1"
14
15
15
16
16
17
@contextmanager
@@ -42,7 +43,7 @@ def test_scan(self):
42
43
f .write (clamd .EICAR )
43
44
f .flush ()
44
45
os .fchmod (f .fileno (), (mine | other ))
45
- expected = {f .name : ('FOUND' , 'Eicar-Test-Signature' )}
46
+ expected = {f .name : ('FOUND' , EICAR_SIG_NAME )}
46
47
47
48
assert self .cd .scan (f .name ) == expected
48
49
@@ -51,7 +52,7 @@ def test_unicode_scan(self):
51
52
f .write (clamd .EICAR )
52
53
f .flush ()
53
54
os .fchmod (f .fileno (), (mine | other ))
54
- expected = {f .name : ('FOUND' , 'Eicar-Test-Signature' )}
55
+ expected = {f .name : ('FOUND' , EICAR_SIG_NAME )}
55
56
56
57
assert self .cd .scan (f .name ) == expected
57
58
@@ -62,13 +63,13 @@ def test_multiscan(self):
62
63
with open (os .path .join (d , "file" + str (i )), 'wb' ) as f :
63
64
f .write (clamd .EICAR )
64
65
os .fchmod (f .fileno (), (mine | other ))
65
- expected [f .name ] = ('FOUND' , 'Eicar-Test-Signature' )
66
+ expected [f .name ] = ('FOUND' , EICAR_SIG_NAME )
66
67
os .chmod (d , (mine | other | execute ))
67
68
68
69
assert self .cd .multiscan (d ) == expected
69
70
70
71
def test_instream (self ):
71
- expected = {'stream' : ('FOUND' , 'Eicar-Test-Signature' )}
72
+ expected = {'stream' : ('FOUND' , EICAR_SIG_NAME )}
72
73
assert self .cd .instream (BytesIO (clamd .EICAR )) == expected
73
74
74
75
def test_insteam_success (self ):
@@ -79,7 +80,7 @@ def test_fdscan(self):
79
80
f .write (clamd .EICAR )
80
81
f .flush ()
81
82
os .fchmod (f .fileno (), (mine | other ))
82
- expected = {f .name : ('FOUND' , 'Eicar-Test-Signature' )}
83
+ expected = {f .name : ('FOUND' , EICAR_SIG_NAME )}
83
84
84
85
assert self .cd .fdscan (f .name ) == expected
85
86
0 commit comments