Esempio n. 1
0
    def test_encode_decode(self):
        """Test that dmtxwrite can decode this library's output
        to the correct string"""

        for string in MatrixTest.test_strings:

            encoder = DataMatrixEncoder(string)
            encoder.save("datamatrix-test.png")

            if not os.path.exists(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)
Esempio n. 2
0
    def test_encode_decode(self):
        """Test that dmtxwrite can decode this library's output
        to the correct string"""

        for string in MatrixTest.test_strings:

            encoder = DataMatrixEncoder(string)
            encoder.save("datamatrix-test.png")

            if not os.path.exists(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)