def test_put_get_single_object(self): """Method to test putting and getting objects to and from S3""" os = AWSObjectStore(self.object_store_config) cached_cuboid_keys = ["CACHED-CUBOID&1&1&1&0&0&12"] fake_data = [b"aaaadddffffaadddfffaadddfff"] object_keys = os.cached_cuboid_to_object_keys(cached_cuboid_keys) os.put_objects(object_keys, fake_data) returned_data = os.get_single_object(object_keys[0]) assert fake_data[0] == returned_data
def test_put_get_objects_syncronous(self): """Method to test putting and getting objects to and from S3""" os = AWSObjectStore(self.object_store_config) cached_cuboid_keys = ["CACHED-CUBOID&1&1&1&0&0&12", "CACHED-CUBOID&1&1&1&0&0&13"] fake_data = [b"aaaadddffffaadddfffaadddfff", b"fffddaaffddffdfffaaa"] object_keys = os.cached_cuboid_to_object_keys(cached_cuboid_keys) os.put_objects(object_keys, fake_data) returned_data = os.get_objects(object_keys) for rdata, sdata in zip(returned_data, fake_data): assert rdata == sdata