automatic db file names
This commit is contained in:
parent
9e48dc408e
commit
a83e1af69b
5 changed files with 44 additions and 6 deletions
30
Cargo.lock
generated
30
Cargo.lock
generated
|
@ -1041,6 +1041,24 @@ name = "fuchsia-zircon-sys"
|
||||||
version = "0.3.3"
|
version = "0.3.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "function_name"
|
||||||
|
version = "0.2.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
dependencies = [
|
||||||
|
"function_name-proc-macro 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "function_name-proc-macro"
|
||||||
|
version = "0.2.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
dependencies = [
|
||||||
|
"proc-macro-crate 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"syn 0.15.44 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "futures"
|
name = "futures"
|
||||||
version = "0.1.29"
|
version = "0.1.29"
|
||||||
|
@ -2058,6 +2076,7 @@ dependencies = [
|
||||||
"diesel_migrations 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"diesel_migrations 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"flame 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
"flame 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"flamer 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"flamer 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"function_name 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"getopts 0.2.21 (registry+https://github.com/rust-lang/crates.io-index)",
|
"getopts 0.2.21 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"id3 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"id3 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"image 0.22.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
"image 0.22.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
@ -2092,6 +2111,14 @@ name = "ppv-lite86"
|
||||||
version = "0.2.6"
|
version = "0.2.6"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "proc-macro-crate"
|
||||||
|
version = "0.1.4"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
dependencies = [
|
||||||
|
"toml 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "proc-macro-hack"
|
name = "proc-macro-hack"
|
||||||
version = "0.5.11"
|
version = "0.5.11"
|
||||||
|
@ -3545,6 +3572,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
"checksum fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba"
|
"checksum fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba"
|
||||||
"checksum fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82"
|
"checksum fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82"
|
||||||
"checksum fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7"
|
"checksum fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7"
|
||||||
|
"checksum function_name 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "88b2afa9b514dc3a75af6cf24d1914e1c7eb6f1b86de849147563548d5c0a0cd"
|
||||||
|
"checksum function_name-proc-macro 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6790a8d356d2f65d7972181e866b92a50a87c27d6a48cbe9dbb8be13ca784c7d"
|
||||||
"checksum futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)" = "1b980f2816d6ee8673b6517b52cb0e808a180efc92e5c19d02cdda79066703ef"
|
"checksum futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)" = "1b980f2816d6ee8673b6517b52cb0e808a180efc92e5c19d02cdda79066703ef"
|
||||||
"checksum futures 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b6f16056ecbb57525ff698bb955162d0cd03bee84e6241c27ff75c08d8ca5987"
|
"checksum futures 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b6f16056ecbb57525ff698bb955162d0cd03bee84e6241c27ff75c08d8ca5987"
|
||||||
"checksum futures-channel 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "fcae98ca17d102fd8a3603727b9259fcf7fa4239b603d2142926189bc8999b86"
|
"checksum futures-channel 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "fcae98ca17d102fd8a3603727b9259fcf7fa4239b603d2142926189bc8999b86"
|
||||||
|
@ -3654,6 +3683,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
"checksum pkg-config 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)" = "05da548ad6865900e60eaba7f589cc0783590a92e940c26953ff81ddbab2d677"
|
"checksum pkg-config 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)" = "05da548ad6865900e60eaba7f589cc0783590a92e940c26953ff81ddbab2d677"
|
||||||
"checksum png 0.15.2 (registry+https://github.com/rust-lang/crates.io-index)" = "247cb804bd7fc86d0c2b153d1374265e67945875720136ca8fe451f11c6aed52"
|
"checksum png 0.15.2 (registry+https://github.com/rust-lang/crates.io-index)" = "247cb804bd7fc86d0c2b153d1374265e67945875720136ca8fe451f11c6aed52"
|
||||||
"checksum ppv-lite86 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "74490b50b9fbe561ac330df47c08f3f33073d2d00c150f719147d7c54522fa1b"
|
"checksum ppv-lite86 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "74490b50b9fbe561ac330df47c08f3f33073d2d00c150f719147d7c54522fa1b"
|
||||||
|
"checksum proc-macro-crate 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "e10d4b51f154c8a7fb96fd6dad097cb74b863943ec010ac94b9fd1be8861fe1e"
|
||||||
"checksum proc-macro-hack 0.5.11 (registry+https://github.com/rust-lang/crates.io-index)" = "ecd45702f76d6d3c75a80564378ae228a85f0b59d2f3ed43c91b4a69eb2ebfc5"
|
"checksum proc-macro-hack 0.5.11 (registry+https://github.com/rust-lang/crates.io-index)" = "ecd45702f76d6d3c75a80564378ae228a85f0b59d2f3ed43c91b4a69eb2ebfc5"
|
||||||
"checksum proc-macro-nested 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "369a6ed065f249a159e06c45752c780bda2fb53c995718f9e484d08daa9eb42e"
|
"checksum proc-macro-nested 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "369a6ed065f249a159e06c45752c780bda2fb53c995718f9e484d08daa9eb42e"
|
||||||
"checksum proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)" = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759"
|
"checksum proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)" = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759"
|
||||||
|
|
|
@ -24,6 +24,7 @@ diesel = { version = "1.4", features = ["sqlite", "r2d2"] }
|
||||||
diesel_migrations = { version = "1.4", features = ["sqlite"] }
|
diesel_migrations = { version = "1.4", features = ["sqlite"] }
|
||||||
flame = { version = "0.2.2", optional = true }
|
flame = { version = "0.2.2", optional = true }
|
||||||
flamer = { version = "0.4", optional = true }
|
flamer = { version = "0.4", optional = true }
|
||||||
|
function_name = "0.2.0"
|
||||||
getopts = "0.2.15"
|
getopts = "0.2.15"
|
||||||
id3 = "0.3"
|
id3 = "0.3"
|
||||||
image = "0.22"
|
image = "0.22"
|
||||||
|
|
|
@ -2,6 +2,7 @@ use actix_http::Request;
|
||||||
use actix_web::dev::*;
|
use actix_web::dev::*;
|
||||||
use actix_web::test::TestRequest;
|
use actix_web::test::TestRequest;
|
||||||
use actix_web::{test, App};
|
use actix_web::{test, App};
|
||||||
|
use function_name::named;
|
||||||
|
|
||||||
use super::configure_test_app;
|
use super::configure_test_app;
|
||||||
use crate::config;
|
use crate::config;
|
||||||
|
@ -55,9 +56,10 @@ fn initial_setup() -> Request {
|
||||||
.to_request()
|
.to_request()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[named]
|
||||||
#[actix_rt::test]
|
#[actix_rt::test]
|
||||||
async fn test_version() {
|
async fn test_version() {
|
||||||
let app = App::new().configure(|cfg| configure_test_app(cfg, "test_version"));
|
let app = App::new().configure(|cfg| configure_test_app(cfg, function_name!()));
|
||||||
let mut service = test::init_service(app).await;
|
let mut service = test::init_service(app).await;
|
||||||
let req = TestRequest::get().uri("/api/version").to_request();
|
let req = TestRequest::get().uri("/api/version").to_request();
|
||||||
let resp = service.call(req).await.unwrap();
|
let resp = service.call(req).await.unwrap();
|
||||||
|
@ -68,9 +70,10 @@ async fn test_version() {
|
||||||
assert_eq!(response_json, dto::Version { major: 4, minor: 0 });
|
assert_eq!(response_json, dto::Version { major: 4, minor: 0 });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[named]
|
||||||
#[actix_rt::test]
|
#[actix_rt::test]
|
||||||
async fn test_initial_setup() {
|
async fn test_initial_setup() {
|
||||||
let app = App::new().configure(|cfg| configure_test_app(cfg, "test_initial_setup"));
|
let app = App::new().configure(|cfg| configure_test_app(cfg, function_name!()));
|
||||||
let mut service = test::init_service(app).await;
|
let mut service = test::init_service(app).await;
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,22 +1,24 @@
|
||||||
use actix_web::dev::Service;
|
use actix_web::dev::Service;
|
||||||
use actix_web::test::TestRequest;
|
use actix_web::test::TestRequest;
|
||||||
use actix_web::{test, App};
|
use actix_web::{test, App};
|
||||||
|
use function_name::named;
|
||||||
|
|
||||||
use super::configure_test_app;
|
use super::configure_test_app;
|
||||||
|
|
||||||
|
#[named]
|
||||||
#[actix_rt::test]
|
#[actix_rt::test]
|
||||||
async fn test_swagger_index() {
|
async fn test_swagger_index() {
|
||||||
let app = App::new().configure(|cfg| configure_test_app(cfg, "test_swagger_index"));
|
let app = App::new().configure(|cfg| configure_test_app(cfg, function_name!()));
|
||||||
let mut service = test::init_service(app).await;
|
let mut service = test::init_service(app).await;
|
||||||
let req = TestRequest::get().uri("/swagger").to_request();
|
let req = TestRequest::get().uri("/swagger").to_request();
|
||||||
let resp = service.call(req).await.unwrap();
|
let resp = service.call(req).await.unwrap();
|
||||||
assert!(resp.status().is_success());
|
assert!(resp.status().is_success());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[named]
|
||||||
#[actix_rt::test]
|
#[actix_rt::test]
|
||||||
async fn test_swagger_index_with_trailing_slash() {
|
async fn test_swagger_index_with_trailing_slash() {
|
||||||
let app = App::new()
|
let app = App::new().configure(|cfg| configure_test_app(cfg, function_name!()));
|
||||||
.configure(|cfg| configure_test_app(cfg, "test_swagger_index_with_trailing_slash"));
|
|
||||||
let mut service = test::init_service(app).await;
|
let mut service = test::init_service(app).await;
|
||||||
let req = TestRequest::get().uri("/swagger/").to_request();
|
let req = TestRequest::get().uri("/swagger/").to_request();
|
||||||
let resp = service.call(req).await.unwrap();
|
let resp = service.call(req).await.unwrap();
|
||||||
|
|
|
@ -1,12 +1,14 @@
|
||||||
use actix_web::dev::Service;
|
use actix_web::dev::Service;
|
||||||
use actix_web::test::TestRequest;
|
use actix_web::test::TestRequest;
|
||||||
use actix_web::{test, App};
|
use actix_web::{test, App};
|
||||||
|
use function_name::named;
|
||||||
|
|
||||||
use super::configure_test_app;
|
use super::configure_test_app;
|
||||||
|
|
||||||
|
#[named]
|
||||||
#[actix_rt::test]
|
#[actix_rt::test]
|
||||||
async fn test_index() {
|
async fn test_index() {
|
||||||
let app = App::new().configure(|cfg| configure_test_app(cfg, "test_index"));
|
let app = App::new().configure(|cfg| configure_test_app(cfg, function_name!()));
|
||||||
let mut service = test::init_service(app).await;
|
let mut service = test::init_service(app).await;
|
||||||
let req = TestRequest::get().uri("/").to_request();
|
let req = TestRequest::get().uri("/").to_request();
|
||||||
let resp = service.call(req).await.unwrap();
|
let resp = service.call(req).await.unwrap();
|
||||||
|
|
Loading…
Add table
Reference in a new issue