From 123cc0e5af953d8212e646ce8dcdc828b399337d Mon Sep 17 00:00:00 2001 From: WendelHime Date: Sun, 23 Jul 2023 17:58:26 -0300 Subject: [PATCH 1/2] feat: add support to more alphanumeric characters --- uQR.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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. From a38980138952a2368d1406c36ccc1faa2ce7d920 Mon Sep 17 00:00:00 2001 From: WendelHime Date: Sun, 23 Jul 2023 17:59:19 -0300 Subject: [PATCH 2/2] feat: add usecase test for generating wifi QR code --- test.py | 8 ++++++++ 1 file changed, 8 insertions(+) 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)