Skip to content

Commit 4cccbe1

Browse files
committed
update tests
1 parent 64bb990 commit 4cccbe1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+650
-289
lines changed

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ async-std = { version = "1.13.1", features = ["attributes", "tokio1"] }
6262
clap = { version = "4.5.35", features = ["derive"] }
6363
quickcheck = "1.0.3"
6464
criterion = "0.5.1"
65-
test-tag = "0.1.4"
6665

6766
[lib]
6867
name = "minio"

common/src/cleanup_guard.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@ impl Drop for CleanupGuard {
5858
Ok(_) => {
5959
//println!("Bucket {} removed successfully", bucket_name),
6060
}
61-
Err(e) => println!("Error removing bucket {}: {:?}", bucket_name, e),
61+
Err(_e) => {
62+
//println!("Error removing bucket {}: {:?}", bucket_name, e)
63+
}
6264
},
6365
Err(_) => println!("Timeout after 60s while removing bucket {}", bucket_name),
6466
}

common/src/example.rs

Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@
1616
use chrono::{DateTime, Utc};
1717
use minio::s3::builders::PostPolicy;
1818
use minio::s3::types::{
19-
AndOperator, Destination, Filter, LifecycleConfig, LifecycleRule, NotificationConfig,
20-
ObjectLockConfig, PrefixFilterRule, QueueConfig, ReplicationConfig, ReplicationRule,
21-
RetentionMode, SuffixFilterRule,
19+
AndOperator, CsvInputSerialization, CsvOutputSerialization, Destination, FileHeaderInfo,
20+
Filter, LifecycleConfig, LifecycleRule, NotificationConfig, ObjectLockConfig, PrefixFilterRule,
21+
QueueConfig, QuoteFields, ReplicationConfig, ReplicationRule, RetentionMode, SelectRequest,
22+
SuffixFilterRule,
2223
};
2324
use minio::s3::utils::utc_now;
2425
use std::collections::HashMap;
@@ -195,3 +196,38 @@ pub fn create_post_policy_example(bucket_name: &str, object_name: &str) -> PostP
195196
.unwrap();
196197
policy
197198
}
199+
/// return (body, data)
200+
pub fn create_select_content_data() -> (String, String) {
201+
let mut data = String::new();
202+
data.push_str("1997,Ford,E350,\"ac, abs, moon\",3000.00\n");
203+
data.push_str("1999,Chevy,\"Venture \"\"Extended Edition\"\"\",,4900.00\n");
204+
data.push_str("1999,Chevy,\"Venture \"\"Extended Edition, Very Large\"\"\",,5000.00\n");
205+
data.push_str("1996,Jeep,Grand Cherokee,\"MUST SELL!\n");
206+
data.push_str("air, moon roof, loaded\",4799.00\n");
207+
let body = String::from("Year,Make,Model,Description,Price\n") + &data;
208+
(body, data)
209+
}
210+
pub fn create_select_content_request() -> SelectRequest {
211+
let request = SelectRequest::new_csv_input_output(
212+
"select * from S3Object",
213+
CsvInputSerialization {
214+
compression_type: None,
215+
allow_quoted_record_delimiter: false,
216+
comments: None,
217+
field_delimiter: None,
218+
file_header_info: Some(FileHeaderInfo::USE),
219+
quote_character: None,
220+
quote_escape_character: None,
221+
record_delimiter: None,
222+
},
223+
CsvOutputSerialization {
224+
field_delimiter: None,
225+
quote_character: None,
226+
quote_escape_character: None,
227+
quote_fields: Some(QuoteFields::ASNEEDED),
228+
record_delimiter: None,
229+
},
230+
)
231+
.unwrap();
232+
request
233+
}

src/s3/builders/append_object.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ impl AppendObjectContent {
227227
.stat_object(&self.bucket, &self.object)
228228
.send()
229229
.await?;
230-
println!("statObjectResponse={:#?}", resp);
230+
//println!("statObjectResponse={:#?}", resp);
231231

232232
let current_file_size = resp.size;
233233

0 commit comments

Comments
 (0)