Skip to content

Commit

Permalink
more tests
Browse files Browse the repository at this point in the history
Signed-off-by: Ashwin Naren <[email protected]>
  • Loading branch information
arihant2math committed Nov 2, 2023
1 parent 05f0b00 commit f731326
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
22 changes: 22 additions & 0 deletions internal/backend/src/meteo/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,25 @@ pub struct MeteoFormattedData {
pub air_quality: MeteoAirQualityJson,
pub raw_data: Vec<Resp>,
}

#[cfg(test)]
mod tests {
#[test]
fn test_get_api_url() {
let location = local::location::Coordinates {
latitude: 37.354,
longitude: -121.955,
};
let urls = crate::meteo::get_api_urls(location, true);
// TODO: actual test
}

#[test]
fn test_get_data() {
let location = local::location::Coordinates {
latitude: 37.354,
longitude: -121.955,
};
let data = crate::meteo::get_combined_data_formatted(location, true).unwrap();
}
}
4 changes: 2 additions & 2 deletions internal/backend/src/nws/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ pub fn get_combined_data_formatted(location: Coordinates, metric: bool) -> crate
mod tests {
#[test]
fn test_get_api_url() {
let location = crate::nws::Coordinates {
let location = local::location::Coordinates {
latitude: 37.354,
longitude: -121.955,
};
Expand All @@ -44,7 +44,7 @@ mod tests {

#[test]
fn test_get_data() {
let location = crate::nws::Coordinates {
let location = local::location::Coordinates {
latitude: 37.354,
longitude: -121.955,
};
Expand Down

0 comments on commit f731326

Please sign in to comment.