Skip to content

Commit

Permalink
Update API pathname in client for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
cccs-rs committed May 27, 2024
1 parent 061317c commit 8cfbc1b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions assemblyline_client/v4_client/module/file.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from assemblyline_client.v4_client.common.utils import api_path_by_module, get_function_kwargs, \
stream_output, raw_output
stream_output, raw_output, api_path


class File(object):
Expand Down Expand Up @@ -52,7 +52,7 @@ def download(self, sha256, encoding=None, sid=None, output=None, password=None):
return self._connection.download(path, stream_output(output))
return self._connection.download(path, raw_output)

def filestore(self, sha256):
def delete_from_filestore(self, sha256):
"""\
Delete a file from the filestore without deleting the file record
Expand All @@ -61,7 +61,7 @@ def filestore(self, sha256):
Throws a Client exception if the file does not exist or if you don't have the rights to delete the file.
"""
return self._connection.delete(api_path_by_module(self, sha256))
return self._connection.delete(api_path('file/filestore', sha256))

def hex(self, sha256, bytes_only=False, length=None):
"""\
Expand Down
4 changes: 2 additions & 2 deletions test/test_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,13 @@ def test_download_to_file_handle(datastore, client):
os.unlink(download_output)

# noinspection PyUnusedLocal
def test_filestore(datastore, filestore, client):
def test_delete_from_filestore(datastore, filestore, client):
file_id = random_id_from_collection(datastore, 'file')

# Delete file from filestore only
# Shouldn't affect the related document in the datastore
assert filestore.exists(file_id)
assert client.file.filestore(file_id)['success']
assert client.file.delete_from_filestore(file_id)['success']
assert not filestore.exists(file_id) and datastore.file.exists(file_id)


Expand Down

0 comments on commit 8cfbc1b

Please sign in to comment.