Skip to content
This repository has been archived by the owner on Jan 3, 2018. It is now read-only.

Commit

Permalink
Include libdmx tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Maximillian Dornseif committed Oct 7, 2013
1 parent 41058ae commit 1c038ba
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -7,7 +7,7 @@ install:
- sudo apt-get install libfreetype6 libfreetype6-dev zlib1g zlib1g-dev
- sudo apt-get install libjpeg62 libjpeg62-dev
- sudo apt-get install python-imaging
- sudo apt-get install libdmtx
- sudo apt-get install libdmtx-dev libdmtx-utils
- pip install virtualenv
- pip install coveralls
- pip install Pillow
Expand Down
3 changes: 1 addition & 2 deletions README.textile
Expand Up @@ -62,5 +62,4 @@ But don't worry. If you need something formal:
The code is available under the Apache License, Version 2.0.


.. image:: https://travis-ci.org/mdornseif/huBarcode.png?branch=master
:target: https://travis-ci.org/mdornseif/huBarcode
!https://travis-ci.org/hudora/huBarcode.png?branch=master!:https://travis-ci.org/hudora/huBarcode
11 changes: 6 additions & 5 deletions hubarcode/datamatrix/matrixtest.py
Expand Up @@ -7,8 +7,8 @@

from __init__ import DataMatrixEncoder

dmtxread_path = "/usr/local/bin/dmtxread"
dmtxwrite_path = "/usr/local/bin/dmtxwrite"
dmtxread_path = "dmtxread"
dmtxwrite_path = "dmtxwrite"


class MatrixTest(unittest.TestCase):
Expand Down Expand Up @@ -48,11 +48,12 @@ def test_encode_decode(self):
encoder = DataMatrixEncoder(string)
encoder.save("datamatrix-test.png")

if not os.path.exists(dmtxread_path):
if not (os.path.exists(os.path.join('/usr/bin', dmtxread_path))
or os.path.exists(os.path.join('/usr/local/bin', dmtxread_path))):
print "%r does not exist, skipping decoding tests" % dmtxread_path
else:
fin = os.popen("%s datamatrix-test.png" % (dmtxread_path))
self.assertEqual(fin.readline()[:-1], string)
fin = os.popen("sh -c '%s datamatrix-test.png'" % (dmtxread_path))
self.assertEqual(fin.readline(), string)

def test_against_dmtx(self):
"""Compare the output of this library with that of dmtxwrite"""
Expand Down

0 comments on commit 1c038ba

Please sign in to comment.