tests pass

This commit is contained in:
ed 2021-06-11 03:10:33 +02:00
parent a45a53fdce
commit 5534c78c17

View file

@ -46,7 +46,7 @@ def main():
with open(vidp, "rb") as f: with open(vidp, "rb") as f:
ovid = f.read() ovid = f.read()
args = ["-p", "4321", "-e2dsa", "-e2tsr"] args = ["-p", "4321", "-e2dsa", "-e2tsr", "--th-ff-jpg"]
pdirs = [] pdirs = []
for d1 in ["r", "w", "a"]: for d1 in ["r", "w", "a"]:
@ -97,12 +97,7 @@ def main():
for d, p in zip(udirs, perms): for d, p in zip(udirs, perms):
u = "{}{}/a.h264?th=j".format(ub, d) u = "{}{}/a.h264?th=j".format(ub, d)
r = requests.get(u) r = requests.get(u)
ok = False ok = bool(r and r.content[:3] == b"\xff\xd8\xff")
if r:
r.raw.decode_content = True
buf = r.raw.read(256)
if buf[:3] == b"\xff\xd8\xff":
ok = True
if ok != (p in ["a"]): if ok != (p in ["a"]):
raise Exception("thumb {} with perm {} at {}".format(ok, p, u)) raise Exception("thumb {} with perm {} at {}".format(ok, p, u))