mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-09-18 12:33:43 +08:00
qrcode: test alignment pattern positions (#38829)
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
import unittest
|
||||
|
||||
from openpilot.common import qrcode as qr
|
||||
from openpilot.common.test import OpenpilotTestCase
|
||||
|
||||
|
||||
class TestQRCode(OpenpilotTestCase):
|
||||
def test_alignment_positions(self):
|
||||
assert qr._alignment_positions(7) == [6, 22, 38]
|
||||
assert qr._alignment_positions(40) == [6, 30, 58, 86, 114, 142, 170]
|
||||
|
||||
@unittest.expectedFailure # the step between patterns rounds the wrong way for version 32
|
||||
def test_alignment_positions_v32(self):
|
||||
assert qr._alignment_positions(32) == [6, 34, 60, 86, 112, 138]
|
||||
Reference in New Issue
Block a user