Skip to content
Merged

Dev #66

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions PipReleaseDoc.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
Python-MCS-SDK is a python software development kit for the [Multi-Chain Storage(MCS)](https://www.multichain.storage) service. It provides a convenient interface for working with the MCS API.

Please take a look at our documentation for how to install and use Python-MCS-SDK:

- [Prerequisites](https://docs.filswan.com/multichain.storage/developer-quickstart/sdk/python-mcs-sdk/prerequisite)
- [Get Started](https://docs.filswan.com/multichain.storage/developer-quickstart/sdk/python-mcs-sdk/get-started)
- [Get Started](https://docs.filswan.com/multichain.storage/developer-quickstart/sdk/python-mcs-sdk/quickstart)

If you find bugs, need help, or want to talk to the developers, please use our mailing lists or chat rooms:

Expand Down
8 changes: 4 additions & 4 deletions test/test_real_download_ipfs_folder.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import pytest


class TestDownloadFolder:
class TestDownloadIPFSFolder:
@pytest.fixture(autouse=True)
def setup(self, shared_real_bucket, shared_current_time):
self.obj = shared_real_bucket
Expand All @@ -22,19 +22,19 @@ def setup(self, shared_real_bucket, shared_current_time):
self.obj.upload_ipfs_folder(self.bucket_name, self.folder_name, self.folder_path)
yield

def test_download_folder_success(self, shared_current_time):
def test_download_IPFS_folder_success(self, shared_current_time):
# 测试下载已存在的文件夹
result = self.obj.download_ipfs_folder(self.bucket_name, self.object_name,
Path(self.folder_path) / ("test" + shared_current_time))
assert result is True
assert os.path.exists(self.folder_path)

def test_download_existing_folder_failure(self):
def test_download_existing_IPFS_folder_failure(self):
# 测试尝试下载已经存在的文件夹
result = self.obj.download_ipfs_folder(self.bucket_name, self.object_name, self.folder_path)
assert result is False

def test_download_non_existing_folder_failure(self):
def test_download_non_existing_IPFS_folder_failure(self):
# 测试尝试下载不存在的文件夹
shutil.rmtree(self.folder_path)
result = self.obj.download_ipfs_folder(self.bucket_name, "non_existing_folder", self.folder_path)
Expand Down
11 changes: 6 additions & 5 deletions test/test_real_upload_ipfs_folder.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import pytest


class TestUploadFolder:
class TestUploadIPFSFolder:
@pytest.fixture(autouse=True)
def setup(self, shared_real_bucket, shared_current_time):
self.obj = shared_real_bucket
Expand All @@ -20,7 +20,8 @@ def setup(self, shared_real_bucket, shared_current_time):
self.obj.create_bucket(self.bucket_name)
yield

def test_upload_folder_success(self):
def test_upload_IPFS_folder_success(self):
print(self.folder_path)
# 尝试上传一个文件夹,预期返回成功的文件夹对象
result = self.obj.upload_ipfs_folder(self.bucket_name, self.folder_name, self.folder_path)
assert result is not None
Expand All @@ -29,7 +30,7 @@ def test_upload_folder_success(self):
os.remove(self.file2)
os.rmdir(self.folder_path)

def test_upload_existing_folder_failure(self):
def test_upload_existing_IPFS_folder_failure(self):
# 尝试上传一个已经存在的文件夹,预期返回None
result = self.obj.upload_ipfs_folder(self.bucket_name, self.folder_name, self.folder_path)
print(result)
Expand All @@ -41,7 +42,7 @@ def test_upload_existing_folder_failure(self):
os.remove(self.file2)
os.rmdir(self.folder_path)

def test_upload_folder_with_non_existing_bucket_failure(self, shared_current_time):
def test_upload_IPFS_folder_with_non_existing_bucket_failure(self, shared_current_time):
# 尝试上传到一个不存在的桶中,预期返回None
result = self.obj.upload_ipfs_folder("non_existing_bucket" + shared_current_time, self.folder_name,
self.folder_path)
Expand All @@ -50,7 +51,7 @@ def test_upload_folder_with_non_existing_bucket_failure(self, shared_current_tim
os.remove(self.file2)
os.rmdir(self.folder_path)

def test_upload_empty_folder_success(self, shared_current_time):
def test_upload_empty_IPFS_folder_success(self, shared_current_time):
empty_folder_path = Path("test_dir")/("test_empty_folder" + shared_current_time)
os.mkdir(empty_folder_path)
result = self.obj.upload_ipfs_folder(self.bucket_name, self.folder_name, empty_folder_path)
Expand Down