This is an automated email from the ASF dual-hosted git repository.
xuanwo pushed a commit to branch fix-stat
in repository https://gitbox.apache.org/repos/asf/incubator-opendal.git
The following commit(s) were added to refs/heads/fix-stat by this push:
new 242b3bfd4 Fix test
242b3bfd4 is described below
commit 242b3bfd4e568e946e439be624a966b3f41aa4ad
Author: Xuanwo <[email protected]>
AuthorDate: Thu Nov 23 12:22:26 2023 +0800
Fix test
Signed-off-by: Xuanwo <[email protected]>
---
core/tests/behavior/blocking_copy.rs | 8 ++++++++
core/tests/behavior/blocking_rename.rs | 8 ++++++++
core/tests/behavior/copy.rs | 8 ++++++++
core/tests/behavior/rename.rs | 8 ++++++++
4 files changed, 32 insertions(+)
diff --git a/core/tests/behavior/blocking_copy.rs
b/core/tests/behavior/blocking_copy.rs
index 5d4a1a45a..421721cf3 100644
--- a/core/tests/behavior/blocking_copy.rs
+++ b/core/tests/behavior/blocking_copy.rs
@@ -76,6 +76,10 @@ pub fn test_blocking_copy_non_existing_source(op:
BlockingOperator) -> Result<()
/// Copy a dir as source should return an error.
pub fn test_blocking_copy_source_dir(op: BlockingOperator) -> Result<()> {
+ if !op.info().full_capability().create_dir {
+ return Ok(());
+ }
+
let source_path = format!("{}/", uuid::Uuid::new_v4());
let target_path = uuid::Uuid::new_v4().to_string();
@@ -90,6 +94,10 @@ pub fn test_blocking_copy_source_dir(op: BlockingOperator)
-> Result<()> {
/// Copy to a dir should return an error.
pub fn test_blocking_copy_target_dir(op: BlockingOperator) -> Result<()> {
+ if !op.info().full_capability().create_dir {
+ return Ok(());
+ }
+
let source_path = uuid::Uuid::new_v4().to_string();
let (source_content, _) = gen_bytes(op.info().full_capability());
diff --git a/core/tests/behavior/blocking_rename.rs
b/core/tests/behavior/blocking_rename.rs
index 378299eca..28565de86 100644
--- a/core/tests/behavior/blocking_rename.rs
+++ b/core/tests/behavior/blocking_rename.rs
@@ -79,6 +79,10 @@ pub fn test_blocking_rename_non_existing_source(op:
BlockingOperator) -> Result<
/// Rename a dir as source should return an error.
pub fn test_blocking_rename_source_dir(op: BlockingOperator) -> Result<()> {
+ if !op.info().full_capability().create_dir {
+ return Ok(());
+ }
+
let source_path = format!("{}/", uuid::Uuid::new_v4());
let target_path = uuid::Uuid::new_v4().to_string();
@@ -93,6 +97,10 @@ pub fn test_blocking_rename_source_dir(op: BlockingOperator)
-> Result<()> {
/// Rename to a dir should return an error.
pub fn test_blocking_rename_target_dir(op: BlockingOperator) -> Result<()> {
+ if !op.info().full_capability().create_dir {
+ return Ok(());
+ }
+
let source_path = uuid::Uuid::new_v4().to_string();
let (source_content, _) = gen_bytes(op.info().full_capability());
diff --git a/core/tests/behavior/copy.rs b/core/tests/behavior/copy.rs
index 5a46776f7..1da12af76 100644
--- a/core/tests/behavior/copy.rs
+++ b/core/tests/behavior/copy.rs
@@ -98,6 +98,10 @@ pub async fn test_copy_non_existing_source(op: Operator) ->
Result<()> {
/// Copy a dir as source should return an error.
pub async fn test_copy_source_dir(op: Operator) -> Result<()> {
+ if !op.info().full_capability().create_dir {
+ return Ok(());
+ }
+
let source_path = format!("{}/", uuid::Uuid::new_v4());
let target_path = uuid::Uuid::new_v4().to_string();
@@ -113,6 +117,10 @@ pub async fn test_copy_source_dir(op: Operator) ->
Result<()> {
/// Copy to a dir should return an error.
pub async fn test_copy_target_dir(op: Operator) -> Result<()> {
+ if !op.info().full_capability().create_dir {
+ return Ok(());
+ }
+
let source_path = uuid::Uuid::new_v4().to_string();
let (content, _) = gen_bytes(op.info().full_capability());
diff --git a/core/tests/behavior/rename.rs b/core/tests/behavior/rename.rs
index eb0a74477..f155653b2 100644
--- a/core/tests/behavior/rename.rs
+++ b/core/tests/behavior/rename.rs
@@ -80,6 +80,10 @@ pub async fn test_rename_non_existing_source(op: Operator)
-> Result<()> {
/// Rename a dir as source should return an error.
pub async fn test_rename_source_dir(op: Operator) -> Result<()> {
+ if !op.info().full_capability().create_dir {
+ return Ok(());
+ }
+
let source_path = format!("{}/", uuid::Uuid::new_v4());
let target_path = uuid::Uuid::new_v4().to_string();
@@ -95,6 +99,10 @@ pub async fn test_rename_source_dir(op: Operator) ->
Result<()> {
/// Rename to a dir should return an error.
pub async fn test_rename_target_dir(op: Operator) -> Result<()> {
+ if !op.info().full_capability().create_dir {
+ return Ok(());
+ }
+
let source_path = uuid::Uuid::new_v4().to_string();
let (content, _) = gen_bytes(op.info().full_capability());