From b8e1f29fda77696599bf0ae8cedd31693352e3c9 Mon Sep 17 00:00:00 2001 From: yanghua Date: Wed, 25 Sep 2024 14:06:15 +0800 Subject: [PATCH] Bug: Fix rm api add wrong objects bug --- Makefile | 5 ++--- tosfs/core.py | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 29f96e9..b354fcf 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,5 @@ .ONESHELL: ENV_PREFIX=$(shell poetry env info -p 2>/dev/null)/bin/ -TEST_DIR?="tosfs/tests/" .PHONY: help help: ## Show the help. @@ -48,11 +47,11 @@ lint: ## Run pep8, black, mypy linters. .PHONY: test test: ## Run tests and generate coverage report. - $(ENV_PREFIX)pytest -vv -s --cov-config .coveragerc --cov=tosfs -l --tb=short --maxfail=1 ${TEST_DIR} --ignore=${TEST_DIR}/test_stability.py + $(ENV_PREFIX)pytest -vv -s --cov-config .coveragerc --cov=tosfs -l --tb=short --maxfail=1 tosfs/tests/ --ignore=tosfs/tests/test_stability.py .PHONY: test_stability test_stability: ## Run stability tests. - $(ENV_PREFIX)pytest -vv -s --cov-config .coveragerc --cov=tosfs -l --tb=short --maxfail=1 ${TEST_DIR}/test_stability.py + $(ENV_PREFIX)pytest -vv -s --cov-config .coveragerc --cov=tosfs -l --tb=short --maxfail=1 tosfs/tests/test_stability.py .PHONY: watch watch: ## Run tests on every change. diff --git a/tosfs/core.py b/tosfs/core.py index db21471..e8b66a2 100644 --- a/tosfs/core.py +++ b/tosfs/core.py @@ -1239,7 +1239,7 @@ def _call_list_objects_type2( ) is_truncated = resp.is_truncated continuation_token = resp.next_continuation_token - all_results.extend(resp.contents + resp.common_prefixes) + all_results.extend(resp.contents) deleting_objects = [ DeletingObject(o.key if hasattr(o, "key") else o.prefix)