mirror of
https://github.com/unshackle-dl/unshackle.git
synced 2026-12-06 07:55:10 +00:00
test: delete slow, timing-based and redundant tests
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
import segno
|
||||
|
||||
from unshackle.core import console
|
||||
from unshackle.core.console import qr_text, show_qr
|
||||
from unshackle.core.console import qr_text
|
||||
|
||||
TOP = {"\u2588": True, "\u2580": True, "\u2584": False, " ": False}
|
||||
BOTTOM = {"\u2588": True, "\u2580": False, "\u2584": True, " ": False}
|
||||
@@ -15,14 +14,3 @@ def test_each_line_holds_two_module_rows_of_the_code() -> None:
|
||||
unpacked += [[TOP[c] for c in line], [BOTTOM[c] for c in line]]
|
||||
assert unpacked[: len(rows)] == rows
|
||||
assert not any(cell for row in unpacked[len(rows) :] for cell in row)
|
||||
|
||||
|
||||
def test_short_text_is_a_full_qr_code_not_a_micro_one() -> None:
|
||||
assert len(qr_text("12345", indent=0).plain.splitlines()) * 2 >= 21 + 4
|
||||
|
||||
|
||||
def test_text_longer_than_a_qr_code_holds_draws_nothing(monkeypatch) -> None:
|
||||
printed: list = []
|
||||
monkeypatch.setattr(console.console, "print", lambda *a, **k: printed.extend(a))
|
||||
show_qr("\u20ac" * 1500)
|
||||
assert printed == []
|
||||
|
||||
Reference in New Issue
Block a user