pub use num_traits::NumCast;
pub use serde_json::json;
pub use structopt::StructOpt;
+pub use reqwest;
pub type JsV = serde_json::Value;
pub type MC = MgmtCommand;
test!(c, "bundle", {
let test_bundle = c.su.ds.example_bundle();
+ let hash_exp = bundles::DigestWrite::of(
+ &mut File::open(&test_bundle).unwrap()
+ )?;
+
c.otter(&["upload-bundle"],&[&test_bundle])?;
let mut w = c.su.w(&c.alice)?;
let bundle_id = bundle_link.find_element(By::ClassName("b_id"))?;
let html = bundle_id.inner_html()?;
assert_eq!(&html, "00000.zip");
+
+ let download = dbgc!(bundle_link.get_attribute("href")?).unwrap();
+ let client = reqwest::blocking::Client::new();
+ let download = Url::parse(&w.current_url()?)?.join(&download)?;
+ let mut resp = client.get(download).send()?;
+ let st = resp.status();
+ assert!(st.is_success(), "{:?}", &st);
+ let mut digester = bundles::DigestWrite::sink();
+ resp.copy_to(&mut digester)?;
+ let got = digester.finish().0;
+ assert_eq!(got, hash_exp);
});
check(&mut w)?;