From 9f4d48f7a1b28f23537b043f17d48bdcb1a2f10b Mon Sep 17 00:00:00 2001 From: Nikolay Kim Date: Thu, 6 Dec 2018 15:03:01 -0800 Subject: [PATCH] update tests --- src/h1/codec.rs | 8 ++++---- src/h1/decoder.rs | 6 +++--- src/httpcodes.rs | 4 ++-- src/httpmessage.rs | 3 ++- src/json.rs | 3 ++- src/response.rs | 6 +++--- src/ws/mod.rs | 2 +- 7 files changed, 17 insertions(+), 15 deletions(-) diff --git a/src/h1/codec.rs b/src/h1/codec.rs index 54c1ce2e6..d67d36085 100644 --- a/src/h1/codec.rs +++ b/src/h1/codec.rs @@ -197,10 +197,10 @@ mod tests { use tokio_io::{AsyncRead, AsyncWrite}; use super::*; - use error::ParseError; - use h1::Message; - use httpmessage::HttpMessage; - use request::Request; + use crate::error::ParseError; + use crate::h1::Message; + use crate::httpmessage::HttpMessage; + use crate::request::Request; #[test] fn test_http_request_chunked_payload_and_next_message() { diff --git a/src/h1/decoder.rs b/src/h1/decoder.rs index 26b28440b..e5971f750 100644 --- a/src/h1/decoder.rs +++ b/src/h1/decoder.rs @@ -612,9 +612,9 @@ mod tests { use tokio_io::{AsyncRead, AsyncWrite}; use super::*; - use error::ParseError; - use httpmessage::HttpMessage; - use message::Head; + use crate::error::ParseError; + use crate::httpmessage::HttpMessage; + use crate::message::Head; impl PayloadType { fn unwrap(self) -> PayloadDecoder { diff --git a/src/httpcodes.rs b/src/httpcodes.rs index 80722734a..7806bd806 100644 --- a/src/httpcodes.rs +++ b/src/httpcodes.rs @@ -73,9 +73,9 @@ impl Response { #[cfg(test)] mod tests { - use body::Body; + use crate::body::Body; + use crate::response::Response; use http::StatusCode; - use response::Response; #[test] fn test_build() { diff --git a/src/httpmessage.rs b/src/httpmessage.rs index e239a7337..373b7ed45 100644 --- a/src/httpmessage.rs +++ b/src/httpmessage.rs @@ -568,11 +568,12 @@ where #[cfg(test)] mod tests { use super::*; + use crate::test::TestRequest; use encoding::all::ISO_8859_2; use encoding::Encoding; use futures::Async; use mime; - use test::TestRequest; + use serde_derive::Deserialize; #[test] fn test_content_type() { diff --git a/src/json.rs b/src/json.rs index 0b6ac377f..bfecf0cc3 100644 --- a/src/json.rs +++ b/src/json.rs @@ -137,8 +137,9 @@ mod tests { use bytes::Bytes; use futures::Async; use http::header; + use serde_derive::{Deserialize, Serialize}; - use test::TestRequest; + use crate::test::TestRequest; impl PartialEq for JsonPayloadError { fn eq(&self, other: &JsonPayloadError) -> bool { diff --git a/src/response.rs b/src/response.rs index e506cd163..5cff612f7 100644 --- a/src/response.rs +++ b/src/response.rs @@ -855,9 +855,9 @@ impl ResponsePool { #[cfg(test)] mod tests { use super::*; - use body::Body; - use http; - use http::header::{HeaderValue, CONTENT_TYPE, COOKIE}; + use crate::body::Body; + use crate::http; + use crate::http::header::{HeaderValue, CONTENT_TYPE, COOKIE}; // use test::TestRequest; diff --git a/src/ws/mod.rs b/src/ws/mod.rs index ccd9ef4ac..02667c964 100644 --- a/src/ws/mod.rs +++ b/src/ws/mod.rs @@ -194,8 +194,8 @@ pub fn handshake_response(req: &Request) -> ResponseBuilder { #[cfg(test)] mod tests { use super::*; + use crate::test::TestRequest; use http::{header, Method}; - use test::TestRequest; #[test] fn test_handshake() {