Compare commits
No commits in common. "10d827c39f989bb8d48760f8bdc806ad93eecf3f" and "60d4458f0d9b220f8afb116e63f32e67465265ed" have entirely different histories.
10d827c39f
...
60d4458f0d
4 changed files with 9 additions and 15 deletions
|
@ -55,8 +55,3 @@ def test_encode_examples(val, width, qint):
|
||||||
assert (
|
assert (
|
||||||
encoded_qint == qint
|
encoded_qint == qint
|
||||||
), f"did not encode {val} to {qint}; got {encoded_qint} ({decoded_val})"
|
), f"did not encode {val} to {qint}; got {encoded_qint} ({decoded_val})"
|
||||||
|
|
||||||
# Previously failed test values -
|
|
||||||
# 4294967296
|
|
||||||
# 18446744073709551616
|
|
||||||
# 13407807929942597099574024998205846127479365820592393377723561443721764030073546976801874298166903427690031858186486050853753882811946569946433649006084096
|
|
||||||
|
|
|
@ -5,22 +5,21 @@ from hypothesis.strategies import integers
|
||||||
import proquint
|
import proquint
|
||||||
|
|
||||||
|
|
||||||
def test_round_trip_16():
|
@given(integers(min_value=0, max_value=1 << 16))
|
||||||
for val in range(0, 1<<16):
|
def test_round_trip_16(val):
|
||||||
assert proquint.Proquint.decode(proquint.Proquint.encode(val, 16)) == val
|
assert proquint.Proquint.decode(proquint.Proquint.encode(val, 16)) == val
|
||||||
|
|
||||||
|
|
||||||
@given(integers(min_value=1<<16, max_value=1 << 32 - 1))
|
@given(integers(min_value=0, max_value=1 << 32))
|
||||||
def test_round_trip_32(val):
|
def test_round_trip_32(val):
|
||||||
assert proquint.Proquint.decode(proquint.Proquint.encode(val, 32)) == val
|
assert proquint.Proquint.decode(proquint.Proquint.encode(val, 32)) == val
|
||||||
|
|
||||||
|
|
||||||
@given(integers(min_value=1<<16, max_value=1 << 64 - 1))
|
@given(integers(min_value=0, max_value=1 << 64))
|
||||||
def test_round_trip_64(val):
|
def test_round_trip_64(val):
|
||||||
assert proquint.Proquint.decode(proquint.Proquint.encode(val, 64)) == val
|
assert proquint.Proquint.decode(proquint.Proquint.encode(val, 64)) == val
|
||||||
|
|
||||||
|
|
||||||
@given(integers(min_value=1<<16, max_value=1 << 512 - 1))
|
@given(integers(min_value=0, max_value=1 << 512))
|
||||||
def test_round_trip_512(val):
|
def test_round_trip_512(val):
|
||||||
assert proquint.Proquint.decode(proquint.Proquint.encode(val, 512)) == val
|
assert proquint.Proquint.decode(proquint.Proquint.encode(val, 512)) == val
|
||||||
|
|
||||||
|
|
|
@ -98,12 +98,12 @@ def create_file(location: Optional[str] = None):
|
||||||
return {"error": "file exists already"}, 409
|
return {"error": "file exists already"}, 409
|
||||||
|
|
||||||
file.save(sanitized_path)
|
file.save(sanitized_path)
|
||||||
row = ctx.db.create_file(
|
fid = ctx.db.create_file(
|
||||||
uid=ctx.uid, filename=file.filename, path=sanitized_path
|
uid=ctx.uid, filename=file.filename, path=sanitized_path
|
||||||
)
|
)
|
||||||
|
|
||||||
if request.form.get("print", "").lower() == "true":
|
if request.form.get("print", "").lower() == "true":
|
||||||
ctx.db.create_job(uid=ctx.uid, fid=row.id)
|
ctx.db.create_job(uid=ctx.uid, fid=fid)
|
||||||
|
|
||||||
return {"status": "ok"}, 202
|
return {"status": "ok"}, 202
|
||||||
|
|
||||||
|
|
|
@ -10,9 +10,9 @@ Mostly related to monitoring and managing Printer state.
|
||||||
from contextlib import closing
|
from contextlib import closing
|
||||||
import logging
|
import logging
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from pprint import pformat
|
|
||||||
from typing import Callable
|
from typing import Callable
|
||||||
from urllib import parse as urlparse
|
from urllib import parse as urlparse
|
||||||
|
from pprint import pformat
|
||||||
|
|
||||||
from cherrypy.process.plugins import Monitor
|
from cherrypy.process.plugins import Monitor
|
||||||
from fastmail import FastMailSMTP
|
from fastmail import FastMailSMTP
|
||||||
|
|
Loading…
Reference in a new issue