File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 88import shutil
99import os
1010import stat
11+ from distutils .version import LooseVersion
1112
1213import pytest
1314
1415mine = (stat .S_IREAD | stat .S_IWRITE )
1516other = stat .S_IROTH
1617execute = (stat .S_IEXEC | stat .S_IXOTH )
1718
18-
1919@contextmanager
2020def mkdtemp (* args , ** kwargs ):
2121 temp_dir = tempfile .mkdtemp (* args , ** kwargs )
@@ -78,13 +78,17 @@ def test_insteam_success(self):
7878 assert self .cd .instream (BytesIO (b"foo" )) == {'stream' : ('OK' , None )}
7979
8080 def test_fdscan (self ):
81+ if LooseVersion (clamd .__version__ ) < LooseVersion ("1.0.3" ):
82+ return
8183 with tempfile .NamedTemporaryFile ('wb' , prefix = "python-clamd" ) as f :
8284 f .write (clamd .EICAR )
8385 f .flush ()
8486 expected = {f .name : ('FOUND' , 'Eicar-Test-Signature' )}
8587 assert self .cd .fdscan (f .name , f .fileno ()) == expected
8688
8789 def test_fdscan_success (self ):
90+ if LooseVersion (clamd .__version__ ) < LooseVersion ("1.0.3" ):
91+ return
8892 with tempfile .NamedTemporaryFile ('wb' , prefix = "python-clamd" ) as f :
8993 f .write (b"foo" )
9094 f .flush ()
You can’t perform that action at this time.
0 commit comments