Acquire.ObjectStore._testing_objstore module¶
-
class
Testing_ObjectStore[source]¶ Bases:
objectThis is a dummy object store that writes objects to the standard posix filesystem when running tests
-
static
close_par(par=None, par_uid=None, url_checksum=None)[source]¶ Close the passed PAR, which provides access to data in the passed bucket
-
static
create_bucket(bucket, bucket_name, compartment=None)[source]¶ Create and return a new bucket in the object store called ‘bucket_name’, optionally placing it into the compartment identified by ‘compartment’. This will raise an ObjectStoreError if this bucket already exists
-
static
create_par(bucket, encrypt_key, key=None, readable=True, writeable=False, duration=3600, cleanup_function=None)[source]¶ Create a pre-authenticated request for the passed bucket and key (if key is None then the request is for the entire bucket). This will return a PAR object that will contain a URL that can be used to access the object/bucket. If writeable is true, then the URL will also allow the object/bucket to be written to. PARs are time-limited. Set the lifetime in seconds by passing in ‘duration’ (by default this is one hour). Note that you must pass in a public key that will be used to encrypt this PAR. This is necessary as the PAR grants access to anyone who can decrypt the URL
-
static
delete_bucket(bucket, force=False)[source]¶ Delete the passed bucket. This should be used with caution. Normally you can only delete a bucket if it is empty. If ‘force’ is True then it will remove all objects/pars from the bucket first, and then delete the bucket. This can cause a LOSS OF DATA!
-
static
get_all_object_names(bucket, prefix=None)[source]¶ Returns the names of all objects in the passed bucket
-
static
get_bucket(bucket, bucket_name, compartment=None, create_if_needed=True)[source]¶ Find and return a new bucket in the object store called ‘bucket_name’, optionally placing it into the compartment identified by ‘compartment’. If ‘create_if_needed’ is True then the bucket will be created if it doesn’t exist. Otherwise, if the bucket does not exist then an exception will be raised.
-
static
get_object(bucket, key)[source]¶ Return the binary data contained in the key ‘key’ in the passed bucket
-
static