mirror of
https://github.com/actix/examples
synced 2025-06-26 09:17:41 +02:00
group imports
This commit is contained in:
@ -24,11 +24,12 @@ async fn main() -> std::io::Result<()> {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use actix_web::body::to_bytes;
|
||||
use actix_web::dev::Service;
|
||||
use actix_web::{http, test, web, App, Error};
|
||||
|
||||
use super::*;
|
||||
|
||||
#[actix_web::test]
|
||||
async fn test_index() -> Result<(), Error> {
|
||||
let app = App::new().route("/", web::get().to(index));
|
||||
|
@ -1,5 +1,4 @@
|
||||
use actix_web::{middleware, App, HttpServer};
|
||||
|
||||
use nested_routing::app_config::config_app;
|
||||
|
||||
#[actix_web::main]
|
||||
|
@ -20,13 +20,14 @@ pub async fn remove_product(_id: web::Path<String>) -> Result<HttpResponse, Erro
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use crate::app_config::config_app;
|
||||
use actix_web::dev::Service;
|
||||
use actix_web::{
|
||||
dev::Service,
|
||||
http::{header, StatusCode},
|
||||
test, App,
|
||||
};
|
||||
|
||||
use crate::app_config::config_app;
|
||||
|
||||
#[actix_web::test]
|
||||
async fn test_add_product() {
|
||||
let app = test::init_service(App::new().configure(config_app)).await;
|
||||
|
Reference in New Issue
Block a user