Lint repo.

This commit is contained in:
Reid 'arrdem' McKenzie 2021-08-04 00:17:20 -06:00
commit 44f4a0aaa8
8 changed files with 15 additions and 14 deletions
projects/proquint

View file

@ -121,7 +121,7 @@ class Proquint(object):
res = 0
for i, c in enumerate([c for c in buffer if c != '-']):
for i, c in enumerate([c for c in buffer if c != "-"]):
if (mag := cls._consonant_to_uint(c)) is not None:
res <<= 4
res += mag
@ -131,7 +131,7 @@ class Proquint(object):
res <<= 2
res += mag
elif i != 5:
raise ValueError('Bad proquint format')
raise ValueError("Bad proquint format")
return res
# Handy aliases

View file

@ -1,7 +1,6 @@
"""Tests based off of known examples."""
import proquint
import pytest
@ -45,12 +44,12 @@ examples = [
]
@pytest.mark.parametrize('val,width,qint', examples)
@pytest.mark.parametrize("val,width,qint", examples)
def test_decode_examples(val, width, qint):
assert proquint.Proquint.decode(qint) == val, f"qint {qint} did not decode"
@pytest.mark.parametrize('val,width,qint', examples)
@pytest.mark.parametrize("val,width,qint", examples)
def test_encode_examples(val, width, qint):
encoded_qint = proquint.Proquint.encode(val, width)
decoded_val = proquint.Proquint.decode(encoded_qint)

View file

@ -1,10 +1,9 @@
"""Tests based off of round-tripping randomly generated examples."""
import proquint
import pytest
from hypothesis import given
from hypothesis.strategies import integers
import proquint
import pytest
@given(integers(min_value=0, max_value=1<<16))