use polyoxide_binance::spot::Spot;
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("/api/v3/time", |url| {
base = url.clone();
async move {
let spot = Spot::builder().base_url(url).build().unwrap();
let _ = spot.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"
);
}