Skip to content

Commit

Permalink
match lengths in features collection with gtfs rt output test
Browse files Browse the repository at this point in the history
  • Loading branch information
kylerchin committed Nov 2, 2024
1 parent f53101d commit 93c2d67
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -658,10 +658,22 @@ mod tests {

assert!(amtrak_results.is_ok());

for entity in amtrak_results.unwrap().unified_feed.entity {
for entity in amtrak_results.as_ref().unwrap().unified_feed.entity.iter() {
//println!("{:?}", entity.trip_update);
}

let raw_data = client
.get("https://maps.amtrak.com/services/MapDataService/trains/getTrainsData")
.send()
.await.unwrap();

let decrypted_string = amtk::decrypt(raw_data.text().await.unwrap().as_str()).unwrap();

let geojson: geojson::GeoJson = decrypted_string.parse::<geojson::GeoJson>().unwrap();
let features_collection: FeatureCollection = FeatureCollection::try_from(geojson).unwrap();

assert_eq!(features_collection.features.len(), amtrak_results.as_ref().unwrap().unified_feed.entity.len());

// println!("{:?}", amtrak_results.unwrap());
}

Expand Down

0 comments on commit 93c2d67

Please sign in to comment.