mod client;
mod deserializers;
mod error;
pub mod requests;
mod types;
pub use self::client::API;
pub use self::error::{Error, ErrorKind};
pub use self::types::{OperatingSystem, Priority, Sound, User, UserType};
#[cfg(test)]
mod test {
use crate::client::{API_URL, API_VERSION};
use crate::requests::Request;
use url::Url;
pub fn assert_req_url<R>(req: &R, path: &str, iter: Option<&[(&str, &str)]>)
where
R: Request,
{
let mut url = Url::parse(&format!("{}/{}", API_URL, API_VERSION)).unwrap();
req.build_url(&mut url);
let expected_url = match iter {
Some(x) => {
Url::parse_with_params(&format!("{}/{}/{}", API_URL, API_VERSION, path), x).unwrap()
}
None => Url::parse(&format!("{}/{}/{}", API_URL, API_VERSION, path)).unwrap(),
};
assert_eq!(expected_url, url);
}
}