Exemple #1
0
    def test_read_code128(self):
        "Read CODE 128 barcodes"
        with capture_stdout() as stdout:
            main([str(Path(__file__).parent.joinpath('code128.png'))])

        if 2 == sys.version_info[0]:
            expected = "Foramenifera\nRana temporaria"
        else:
            expected = "b'Foramenifera'\nb'Rana temporaria'"

        self.assertEqual(expected, stdout.getvalue().strip())
Exemple #2
0
    def test_read_qrcode(self):
        "Read QR code"
        with capture_stdout() as stdout:
            main([str(Path(__file__).parent.joinpath('qrcode.png'))])

        if 2 == sys.version_info[0]:
            expected = "Thalassiodracon"
        else:
            expected = "b'Thalassiodracon'"

        self.assertEqual(expected, stdout.getvalue().strip())