Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added more tests #26

Merged
merged 2 commits into from
Jan 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#[forbid(unsafe_code)]
mod aircraft_db;
mod aircraft_owners;
mod aircraft_types;
Expand Down
33 changes: 25 additions & 8 deletions tests/it/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,6 @@ async fn ads_b_lost_on_ground() -> Result<(), Box<dyn Error>> {
Ok(())
}

#[tokio::test]
async fn fs_azure() -> Result<(), Box<dyn Error>> {
let client = flights::fs_azure::initialize_anonymous("privatejets", "data");

let _ = flights::positions("459cd3", date!(2020 - 01 - 01), Some(&client)).await?;
Ok(())
}

#[tokio::test]
async fn case_459257_2023_12_17() -> Result<(), Box<dyn Error>> {
let legs = legs(date!(2023 - 12 - 17), date!(2023 - 12 - 20), "459257", None).await?;
Expand Down Expand Up @@ -122,3 +114,28 @@ async fn case_45c824_2023_12_12() -> Result<(), Box<dyn Error>> {
assert!(legs[2].duration().as_seconds_f32() < day);
Ok(())
}

#[tokio::test]
async fn fs_azure() -> Result<(), Box<dyn Error>> {
let client = flights::fs_azure::initialize_anonymous("privatejets", "data");

let _ = flights::positions("459cd3", date!(2020 - 01 - 01), Some(&client)).await?;
Ok(())
}

#[tokio::test]
async fn airports() -> Result<(), Box<dyn Error>> {
let airports = flights::airports_cached().await?;

let airport = flights::closest((57.094, 9.854), &airports);
assert_eq!(airport.name, "Aalborg Airport");
Ok(())
}

#[tokio::test]
async fn loads() -> Result<(), Box<dyn Error>> {
let _ = flights::load_aircraft_owners()?;
let _ = flights::load_private_jet_types()?;
let _ = flights::load_owners()?;
Ok(())
}
Loading