1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-06-26 06:57:43 +02:00

refactor http-test server

This commit is contained in:
Nikolay Kim
2019-12-12 23:08:38 +06:00
parent db1d6b7963
commit 4937c9f9c2
17 changed files with 252 additions and 296 deletions

View File

@ -1,6 +1,6 @@
use actix_codec::{AsyncRead, AsyncWrite, Framed};
use actix_http::{body, h1, ws, Error, HttpService, Request, Response};
use actix_http_test::TestServer;
use actix_http_test::test_server;
use actix_utils::framed::Dispatcher;
use bytes::Bytes;
use futures::future;
@ -37,7 +37,7 @@ async fn service(msg: ws::Frame) -> Result<ws::Message, Error> {
#[actix_rt::test]
async fn test_simple() {
let mut srv = TestServer::start(|| {
let mut srv = test_server(|| {
HttpService::build()
.upgrade(actix_service::fn_service(ws_service))
.finish(|_| future::ok::<_, ()>(Response::NotFound()))