You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opendal.apache.org by "Xuanwo (via GitHub)" <gi...@apache.org> on 2023/04/26 07:33:07 UTC
[GitHub] [incubator-opendal] Xuanwo commented on a diff in pull request #2131: test(core): test for `write_with_cache_control`
Xuanwo commented on code in PR #2131:
URL: https://github.com/apache/incubator-opendal/pull/2131#discussion_r1177461627
##########
core/tests/behavior/write.rs:
##########
@@ -179,6 +180,50 @@ pub async fn test_write_with_special_chars(op: Operator) -> Result<()> {
Ok(())
}
+// Write a single file with cache control should succeed.
+pub async fn test_write_with_cache_control(op: Operator) -> Result<()> {
+ if !(op.info().can_presign() && op.info().capability().write_with_cache_control) {
+ return Ok(());
+ }
+
+ let path = uuid::Uuid::new_v4().to_string();
+ let (content, _) = gen_bytes();
+
+ let target_cache_control = "max-age=3600";
+
+ let mut op_write = OpWrite::default();
+ op_write = op_write.with_cache_control(target_cache_control);
+
+ op.write_with(&path, op_write, content.clone()).await?;
+
+ let signed_req = op
Review Comment:
We can use stat to test cache control
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org