Commit 15d0f29a authored by Nugine's avatar Nugine
Browse files

s3s: http: keep_alive_body: fix test

parent dda3c098
Loading
Loading
Loading
Loading
+7 −9
Original line number Diff line number Diff line
use std::{
    future::Future,
    pin::Pin,
    task::{Context, Poll},
    time::Duration,
};
use crate::{http::Response, StdError};

use std::future::Future;
use std::pin::Pin;
use std::task::{Context, Poll};
use std::time::Duration;

use bytes::Bytes;
use http_body::{Body, Frame};
use tokio::time::Interval;

use crate::{http::Response, StdError};

// sends whitespace while the future is pending
pin_project_lite::pin_project! {

@@ -145,7 +143,7 @@ mod tests {
    async fn keep_alive_body_fill_withespace() {
        let body = KeepAliveBody::new(
            async {
                tokio::time::sleep(Duration::from_millis(50)).await;
                tokio::time::sleep(Duration::from_millis(45)).await;

                let mut res = Response::with_status(StatusCode::OK);
                res.body = Bytes::from_static(b"hello world").into();
+3 −0
Original line number Diff line number Diff line
@@ -19,6 +19,9 @@ pub use self::multipart::*;
mod body;
pub use self::body::*;

mod keep_alive_body;
pub use self::keep_alive_body::KeepAliveBody;

mod request;
pub use self::request::Request;

+1 −1
Original line number Diff line number Diff line
@@ -5,7 +5,7 @@ use crate::dto::SelectObjectContentEventStream;
use crate::dto::{Metadata, StreamingBlob, Timestamp, TimestampFormat};
use crate::error::{S3Error, S3Result};
use crate::http::{HeaderName, HeaderValue};
use crate::keep_alive_body::KeepAliveBody;
use crate::http::KeepAliveBody;
use crate::utils::format::fmt_timestamp;
use crate::xml;
use crate::StdError;
+0 −1
Original line number Diff line number Diff line
@@ -43,7 +43,6 @@ pub mod service;
pub mod stream;

pub mod checksum;
pub mod keep_alive_body;

pub use self::error::*;
pub use self::http::Body;