()
return ServiceStatus(False, "Failed to save a file to the blobdb")
Save something to the blobdb and try reading it back.
Save something to the blobdb and try reading it back.
Save something to the blobdb and try reading it back .
def check_blobdb():
    """Save something to the blobdb and try reading it back."""
    db = get_blob_db()
    contents = b"It takes Pluto 248 Earth years to complete one orbit!"
    meta = db.put(
        BytesIO(contents),
        domain="<unknown>",
        parent_id="check_blobdb",
        type_code=CODES.tempfile,
    )
    with db.get(meta=meta) as fh:
        res = fh.read()
    db.delete(key=meta.key)
    if res == contents:
        return ServiceStatus(True, "Successfully saved a file to the blobdb")
    return ServiceStatus(False, "Failed to save a file to the blobdb")
def check_blobdb ( ) : db = get_blob_db ( ) contents = b"It takes Pluto 248 Earth years to complete one orbit!" meta = db . put ( BytesIO ( contents ) , domain = "<unknown>" , parent_id = "check_blobdb" , type_code = CODES . tempfile , ) with db . get ( meta = meta ) as fh : res = fh . read ( ) db . delete ( key = meta . key ) if res == contents : return ServiceStatus ( True , "Successfully saved a file to the blobdb" ) return ServiceStatus ( False , "Failed to save a file to the blobdb" )