Testing
This commit is contained in:
parent
7bc62cd896
commit
19a8872010
|
@ -1,4 +1,5 @@
|
|||
*.pyc
|
||||
*.swp
|
||||
.DS_Store
|
||||
.tox
|
||||
build
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
language: python
|
||||
python: "2.7"
|
||||
sudo: false
|
||||
|
||||
env:
|
||||
- TOX_ENV=py27
|
||||
- TOX_ENV=py33
|
||||
- TOX_ENV=py34
|
||||
- TOX_ENV=py35
|
||||
|
||||
install:
|
||||
- pip install tox --use-mirrors
|
||||
|
||||
script:
|
||||
- tox -e $TOX_ENV
|
||||
|
||||
matrix:
|
||||
# Python 3.5 not yet available on travis, watch this to see when it is.
|
||||
fast_finish: true
|
||||
allow_failures:
|
||||
- env: TOX_ENV=py35
|
|
@ -27,14 +27,15 @@ class PdfReaderTestCases(unittest.TestCase):
|
|||
ipdf_p1 = ipdf.getPage(0)
|
||||
|
||||
# Retrieve the text of the PDF
|
||||
pdftext_file = open(os.path.join(RESOURCE_ROOT, 'crazyones.txt'), 'r')
|
||||
with open(os.path.join(RESOURCE_ROOT, 'crazyones.txt'), 'rb') as pdftext_file:
|
||||
pdftext = pdftext_file.read()
|
||||
ipdf_p1_text = ipdf_p1.extractText().replace('\n', '')
|
||||
|
||||
ipdf_p1_text = ipdf_p1.extractText().replace('\n', '').encode('utf-8')
|
||||
|
||||
# Compare the text of the PDF to a known source
|
||||
self.assertEqual(ipdf_p1_text.encode('utf-8', errors='ignore'), pdftext,
|
||||
self.assertEqual(ipdf_p1_text, pdftext,
|
||||
msg='PDF extracted text differs from expected value.\n\nExpected:\n\n%r\n\nExtracted:\n\n%r\n\n'
|
||||
% (pdftext, ipdf_p1_text.encode('utf-8', errors='ignore')))
|
||||
% (pdftext, ipdf_p1_text))
|
||||
|
||||
|
||||
class AddJsTestCase(unittest.TestCase):
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
[tox]
|
||||
envlist =
|
||||
py26, py27, py33, py34, py35
|
||||
|
||||
[testenv]
|
||||
commands = python -m unittest Tests.tests
|
||||
|
||||
[testenv:py26]
|
||||
basepython = python2.6
|
||||
|
||||
[testenv:py27]
|
||||
basepython = python2.7
|
||||
|
||||
[testenv:py33]
|
||||
basepython = python3.3
|
||||
|
||||
[testenv:py34]
|
||||
basepython = python3.4
|
||||
|
||||
[testenv:py35]
|
||||
basepython = python3.5
|
Loading…
Reference in New Issue