diff --git a/tc_aws/aws/storage.py b/tc_aws/aws/storage.py index 74ce80c..c3f0bd6 100644 --- a/tc_aws/aws/storage.py +++ b/tc_aws/aws/storage.py @@ -82,12 +82,12 @@ def set(self, bytes, abspath, callback=None): ) @return_future - def remove(self, path, callback=None): + def remove(self, abspath, callback=None): """ - Deletes data at path - :param string path: Path to delete + Deletes data at abspath + :param string abspath: Absolute path to delete """ - self.storage.delete(path, callback) + self.storage.delete(abspath, callback) @return_future def exists(self, path, callback): diff --git a/tc_aws/storages/s3_storage.py b/tc_aws/storages/s3_storage.py index 471d2ec..3e898c6 100644 --- a/tc_aws/storages/s3_storage.py +++ b/tc_aws/storages/s3_storage.py @@ -40,6 +40,14 @@ def once_written(response): self.set(bytes, self._normalize_path(path), callback=once_written) + @return_future + def remove(self, path, callback=None): + """ + Deletes data at path + :param string path: Path to delete + """ + super(Storage, self).remove(self._normalize_path(path), callback) + @return_future def get(self, path, callback): """ diff --git a/tests/test_storage.py b/tests/test_storage.py index 686294f..9427683 100644 --- a/tests/test_storage.py +++ b/tests/test_storage.py @@ -54,7 +54,7 @@ def test_can_get_image_inexistance(self): @gen_test def test_can_remove_instance(self): - config = Config(TC_AWS_STORAGE_BUCKET=s3_bucket) + config = Config(TC_AWS_STORAGE_BUCKET=s3_bucket,TC_AWS_STORAGE_ROOT_PATH='nana') storage = Storage(Context(config=config, server=get_server('ACME-SEC'))) yield storage.put(IMAGE_URL % '4', IMAGE_BYTES) yield storage.remove(IMAGE_URL % '4')