aboutsummaryrefslogtreecommitdiff
path: root/src/garage/tests/common
diff options
context:
space:
mode:
authortrinity-1686a <trinity@deuxfleurs.fr>2022-03-22 18:20:39 +0100
committerGitea <gitea@fake.local>2022-03-23 10:22:37 +0100
commit8565f7dc314f194ba85e9a0c8a021b9565c22e36 (patch)
treedabe9976b339cae16bce99dc3f94a04b69719628 /src/garage/tests/common
parent8db6b845591d20d7b9fa9334fad6fb3b556c4432 (diff)
downloadgarage-8565f7dc314f194ba85e9a0c8a021b9565c22e36.tar.gz
garage-8565f7dc314f194ba85e9a0c8a021b9565c22e36.zip
cleanup
Diffstat (limited to 'src/garage/tests/common')
-rw-r--r--src/garage/tests/common/custom_requester.rs23
1 files changed, 4 insertions, 19 deletions
diff --git a/src/garage/tests/common/custom_requester.rs b/src/garage/tests/common/custom_requester.rs
index 11dc10d6..580691a1 100644
--- a/src/garage/tests/common/custom_requester.rs
+++ b/src/garage/tests/common/custom_requester.rs
@@ -22,16 +22,6 @@ pub struct CustomRequester {
impl CustomRequester {
pub fn new(instance: &Instance) -> Self {
- /*
- let credentials = Credentials::new(
- &instance.key.id,
- &instance.key.secret,
- None,
- None,
- "garage-integ-test",
- );
- let endpoint = Endpoint::immutable(instance.uri());
- */
CustomRequester {
key: instance.key.clone(),
uri: instance.uri(),
@@ -53,13 +43,6 @@ impl CustomRequester {
vhost_style: false,
}
}
- /*
- pub async fn request(&self, method: &str, path: String, headers: &HashMap<String, (bool, String)>, body: &[u8], vhost_style: bool) -> hyper::Result<Response<Body>> {
- let request = Request::builder()
- .method(
- self.client.request(todo!()).await
- }
- */
}
pub struct RequestBuilder<'a> {
@@ -160,8 +143,10 @@ impl<'a> RequestBuilder<'a> {
"x-amz-decoded-content-length".to_owned(),
self.body.len().to_string(),
);
- // this is a pretty lazy and inefficient way to do it, but it's enought for
- // test code.
+ // Get lenght of body by doing the conversion to a streaming body with an
+ // invalid signature (we don't know the seed) just to get its length. This
+ // is a pretty lazy and inefficient way to do it, but it's enought for test
+ // code.
all_headers.insert(
"content-length".to_owned(),
to_streaming_body(&self.body, size, String::new(), signer.clone(), now, "")