Skip to content
Snippets Groups Projects

Resolve "Test: Improve tests"

Merged Maaz Ahmed requested to merge 36-test-improve-tests into main
6 files
+ 52
68
Compare changes
  • Side-by-side
  • Inline
Files
6
+ 6
25
use mquery::{
query::{self, Metric},
Auth, QueryManager,
QueryManager,
};
use tokio::runtime::Runtime;
mod utils;
// TODO: Create proper tests with local server
#[test]
fn deserialize_response() {
let (url, token) = get_url_token();
let rt = Runtime::new().unwrap();
let query = format!(
"sum(M40c82231{{uuid=\"{}\"}}[10d])",
"1bed9384-5d24-11e3-abe4-2d513ee73a00"
);
let _ = rt
.block_on(
QueryManager::new(url.parse().unwrap())
.auth(Auth::Bearer(token))
.query(query),
)
#[tokio::test]
async fn deserialize_response() {
let _resp = QueryManager::new(utils::URL.parse().unwrap())
.query("metric")
.await
.unwrap();
}
@@ -48,11 +37,3 @@ async fn raw_response() {
.await
.unwrap();
}
fn get_url_token() -> (String, String) {
dotenv::dotenv().expect("No .env file found in working dir");
(
std::env::var("VM_URL").expect("VM URL not found in env"),
std::env::var("VM_TOKEN").expect("VM URL not found in env"),
)
}
Loading