Helper functions for other tests
There are kinda random and really just push away seams from the UT's themselves
This commit is contained in:
parent
14f91e2240
commit
85acc6a309
19
server/src/testing/mod.rs
Normal file
19
server/src/testing/mod.rs
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
// Functions which are only really useful for the unit tests but which show up
|
||||||
|
// constantly in the tests themselves
|
||||||
|
|
||||||
|
#[cfg(test)]
|
||||||
|
pub fn get_pool() -> mysql_async::Pool {
|
||||||
|
use dotenv::dotenv;
|
||||||
|
use mysql_async::Pool;
|
||||||
|
|
||||||
|
dotenv().ok();
|
||||||
|
return Pool::new(&std::env::var("DATABASE_URL").unwrap())
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(test)]
|
||||||
|
pub fn hyper_resp() -> hyper::Response<hyper::Body> {
|
||||||
|
use hyper::{Response, Body};
|
||||||
|
|
||||||
|
Response::new(Body::empty())
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user