Wrapped test
This commit is contained in:
@@ -32,21 +32,28 @@ pub async fn fetch_wsdc_info(id: u32) -> Result<DanceInfo, DanceInfoError> {
|
||||
Ok(x.into())
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[ignore = "Only run when the mock api is setup"]
|
||||
fn test_fetch_wsdc() {
|
||||
let rt = match tokio::runtime::Builder::new_current_thread()
|
||||
.enable_all()
|
||||
.build()
|
||||
{
|
||||
Ok(o) => o,
|
||||
Err(e) => {
|
||||
tracing::error!("Could not start runtime: {e}");
|
||||
return;
|
||||
}
|
||||
};
|
||||
let x = rt.block_on(fetch_wsdc_info(7));
|
||||
dbg!(x);
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
#![allow(clippy::unwrap_used, reason="Allow unwrap in tests")]
|
||||
use crate::worldsdc::fetch_wsdc_info;
|
||||
|
||||
#[test]
|
||||
#[ignore = "Only run when the mock api is setup"]
|
||||
fn test_fetch_wsdc() {
|
||||
let rt = match tokio::runtime::Builder::new_current_thread()
|
||||
.enable_all()
|
||||
.build()
|
||||
{
|
||||
Ok(o) => o,
|
||||
Err(e) => {
|
||||
tracing::error!("Could not start runtime: {e}");
|
||||
return;
|
||||
}
|
||||
};
|
||||
let x = rt.block_on(fetch_wsdc_info(7));
|
||||
dbg!(&x);
|
||||
x.unwrap();
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(thiserror::Error, Debug)]
|
||||
|
||||
Reference in New Issue
Block a user