Skip to content

Commit 0c23eff

Browse files
committed
Only test fdscan for versions >= 1.0.3
1 parent 96f766b commit 0c23eff

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/tests/test_api.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@
88
import shutil
99
import os
1010
import stat
11+
from distutils.version import LooseVersion
1112

1213
import pytest
1314

1415
mine = (stat.S_IREAD | stat.S_IWRITE)
1516
other = stat.S_IROTH
1617
execute = (stat.S_IEXEC | stat.S_IXOTH)
1718

18-
1919
@contextmanager
2020
def 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()

0 commit comments

Comments
 (0)