Use a blob I can retrieve.

If you add me on SSB, you should be able to get it too :p
This commit is contained in:
Pedro Ferreira 2019-06-14 22:02:45 +02:00
parent 166914144d
commit 77d1477106

View File

@ -51,14 +51,13 @@ async def test_client():
break break
img_data = b'' img_data = b''
async for msg in api.call('blobs.get', ['&H4MFPEWh7gAbZG/4TaSsaJI6Hi8lh7PItrHTnaxoSfg=.sha256'], 'source'): async for msg in api.call('blobs.get', ['&kqZ52sDcJSHOx7m4Ww80kK1KIZ65gpGnqwZlfaIVWWM=.sha256'], 'source'):
if msg.type.name == 'BUFFER': if msg.type.name == 'BUFFER':
img_data += msg.data img_data += msg.data
if msg.type.name == 'JSON' and msg.data == b'true': if msg.type.name == 'JSON' and msg.data == b'true':
print(base64.b64encode(hashlib.sha256(img_data).digest())) assert (base64.b64encode(hashlib.sha256(img_data).digest()) ==
assert base64.b64encode(hashlib.sha256(img_data).digest() b'kqZ52sDcJSHOx7m4Ww80kK1KIZ65gpGnqwZlfaIVWWM=')
) == b'H4MFPEWh7gAbZG/4TaSsaJI6Hi8lh7PItrHTnaxoSfg=' with open('./ub1k.jpg', 'wb') as f:
with open('./Autonomouscar1956.jpg', 'wb') as f:
f.write(img_data) f.write(img_data)