geocode 0.1.1

Find location information by using Google Maps or DataScienceToolkit API
extern crate cabot;
extern crate url;
extern crate serde;
extern crate serde_json;
#[macro_use]
extern crate serde_derive;

pub mod structs;
pub mod google;
pub mod ds_toolkit;
// pub mod nominatim;

#[cfg(test)]
mod tests {
    use google;
    use ds_toolkit;
    // use nominatim;
    #[test]
    fn returns_data_for_existing_place() {
        let address = "santa rosa,ca";
        let ds_res = ds_toolkit::geocode(address).unwrap();
        let goog_res = google::geocode(address).unwrap();
        // let nom_res = nominatim::geocode("santa rosa, ca").unwrap();
        // println!("{:?}", nom_res);
        // assert_eq!(nom_res.location.lat, 38.450412);
        // assert_eq!(nom_res.location.lng, -122.783159);
        // println!("{:?}", ds_res.formatted_address);
        assert_eq!(ds_res.location.lat, 38.450412);
        assert_eq!(ds_res.location.lng, -122.783159);
        assert_eq!(ds_res.formatted_address, address.to_string());
        assert_eq!(goog_res.location.lat, 38.440429);
        assert_eq!(goog_res.location.lng, -122.7140548);
    }

    #[test]
    fn returns_err_for_non_existing_place() {
        let ds_res = ds_toolkit::geocode("santa dfdfdfdfdfdf");
        let goog_res = google::geocode("santa dfdfdfdfdfdf");
        // let nom_res = nominatim::geocode("santa dfdfdfdfdfdf");
        // println!("{:?}", nom_res);
        // assert_eq!(nom_res.err(), Some(google::ERR_NO_RESULTS.to_string()));
        assert_eq!(ds_res.err(), Some(google::ERR_NO_RESULTS.to_string()));
        assert_eq!(goog_res.err(), Some(google::ERR_NO_RESULTS.to_string()));
    }
}