tests cleanup; cargo clippy fixes, minor doc updates (#177)
* Tests cleanup; cargo clippy fixes, minor doc updates * updated label checker workflow
This commit is contained in:
@@ -14,6 +14,7 @@ chrono = "0.4.41"
|
||||
reqwest = "0.12.20"
|
||||
http = "1.3.1"
|
||||
futures = "0.3.31"
|
||||
uuid = { version = "1.17.0", features = ["v4"] }
|
||||
|
||||
[lib]
|
||||
name = "minio_common"
|
||||
|
||||
@@ -15,16 +15,24 @@
|
||||
|
||||
use http::{Response as HttpResponse, StatusCode};
|
||||
use minio::s3::error::Error;
|
||||
use rand::distributions::{Alphanumeric, DistString};
|
||||
use rand::distributions::Standard;
|
||||
use rand::{Rng, thread_rng};
|
||||
use uuid::Uuid;
|
||||
|
||||
pub fn rand_bucket_name() -> String {
|
||||
Alphanumeric
|
||||
.sample_string(&mut rand::thread_rng(), 8)
|
||||
.to_lowercase()
|
||||
format!("test-bucket-{}", Uuid::new_v4())
|
||||
}
|
||||
|
||||
pub fn rand_object_name() -> String {
|
||||
Alphanumeric.sample_string(&mut rand::thread_rng(), 20)
|
||||
format!("test-object-{}", Uuid::new_v4())
|
||||
}
|
||||
|
||||
pub fn rand_object_name_utf8(len: usize) -> String {
|
||||
let rng = thread_rng();
|
||||
rng.sample_iter::<char, _>(Standard)
|
||||
.filter(|c| !c.is_control())
|
||||
.take(len)
|
||||
.collect()
|
||||
}
|
||||
|
||||
pub async fn get_bytes_from_response(v: Result<reqwest::Response, Error>) -> bytes::Bytes {
|
||||
|
||||
Reference in New Issue
Block a user