use polyoxide_binance::usdm::Usdm;
use polyoxide_test_support::query::headers_sent;
#[tokio::test]
async fn a_time_request_sends_exactly_the_default_headers() {
let mut base = String::new();
let headers = headers_sent("/fapi/v1/time", |url| {
base = url.clone();
async move {
let usdm = Usdm::builder().base_url(url).build().unwrap();
let _ = usdm.health().time().send().await;
}
})
.await;
let host = base.trim_start_matches("http://");
assert_eq!(
headers,
[
("accept", "*/*"),
("accept-encoding", "gzip"),
("host", host)
]
.map(|(name, value)| (name.to_owned(), value.to_owned())),
"`health().time` sent a header set other than reqwest's defaults with gzip"
);
}