diff --git a/test.py b/test.py index a279671a..ed9d1ea3 100644 --- a/test.py +++ b/test.py @@ -34,3 +34,11 @@ def test_qr_library_equivalence(self): # The two rows from the two libraries should be identical self.assertEqual(len(micro_row), len(macro_row)) + +class TestWifiCreation(unittest.TestCase): + def test_render_matrix(self): + micro_qr = MicroQRCode() + ssid, password = 'test', 'test' + micro_qr.add_data('WIFI:S:{};T:WPA;P:{};H:false;;'.format(ssid, password)) + matrix = micro_qr.render_matrix() + self.assertGreater(len(matrix), 0) diff --git a/uQR.py b/uQR.py index d587581e..a74544cb 100644 --- a/uQR.py +++ b/uQR.py @@ -388,7 +388,7 @@ def make_rs_blocks(version, error_correction): MODE_KANJI: 12, } -ALPHA_NUM = b'0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:' +ALPHA_NUM = b'0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:;#&{}[](),=\'"\\' RE_ALPHA_NUM = re.compile(b'^[' + ALPHA_NUM + b']*') # The number of bits for numeric delimited data lengths.