Enable clamav integration tests on Travis CI

This commit is contained in:
Marius Gedminas 2019-10-22 17:04:09 +03:00
parent bbb90eba81
commit 7e94e542b3
2 changed files with 14 additions and 6 deletions

View file

@ -5,6 +5,10 @@ python:
- "3.6"
- "3.7"
# command to install dependencies
addons:
apt:
packages:
- clamav-daemon
install:
- pip install tox-travis coveralls
# command to run tests
@ -16,7 +20,7 @@ notifications:
after_script:
- coveralls
matrix:
allow_failures:
- python: "3.5"
- python: "3.6"
- python: "3.7"
allow_failures:
- python: "3.5"
- python: "3.6"
- python: "3.7"

View file

@ -51,6 +51,10 @@ class TestClamav (unittest.TestCase):
'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAW0NMQU1BVl' \
'0AEAAAABAAAAACAAABAAAAAAAAAAAAAAAAAAAAAAAAwA==">t</a>'
infected, errors = clamav.scan(data, self.clamav_conf)
msg = 'stream: ClamAV-Test-File(2d1206194bd704385e37000be6113f73:781) FOUND\n'
self.assertTrue(msg in infected)
# different versions of clamav report different responses, apparently
acceptable_responses = (
['stream: ClamAV-Test-File(2d1206194bd704385e37000be6113f73:781) FOUND\n'],
['stream: Clamav.Test.File-6(aa15bcf478d165efd2065190eb473bcb:544) FOUND\n'],
)
self.assertIn(infected, acceptable_responses)
self.assertFalse(errors)