From 9d939616c71c19899f630ad189fee8daa5d47f5f Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Wed, 24 Feb 2021 22:22:16 +0000 Subject: [PATCH] tests: fetch sse etc. Signed-off-by: Ian Jackson --- apitest/at-otter.rs | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/apitest/at-otter.rs b/apitest/at-otter.rs index 20d2d862..98e5bb55 100644 --- a/apitest/at-otter.rs +++ b/apitest/at-otter.rs @@ -45,6 +45,30 @@ impl Ctx { let body = resp.text()?; let dom = scraper::Html::parse_document(&body); dbg!(&body, &dom); + + let ctoken = dom + .select(&"#main-body".try_into().unwrap()) + .next().unwrap() + .value().attr("data-ctoken") + .unwrap(); + dbg!(&ctoken); + + let gen: Generation = Generation(dom + .select(&"#main-body".try_into().unwrap()) + .next().unwrap() + .value().attr("data-gen") + .unwrap() + .parse().unwrap()); + dbg!(gen); + + let sse = client.get( + &self.ds + .also(&[("ctoken", ctoken), + ("gen", &gen.to_string())]) + .subst("@url@/_/updates?ctoken=@ctoken@&gen=@gen@")? + ).send()?; + + //sse.copy_to(&mut std::io::stderr())?; } } -- 2.30.2