From f50dfd5045170e1435270e6de3a03a74807ee392 Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Sun, 23 Sep 2018 19:08:06 +0200 Subject: Begin implementaton of undocumented abook api to fetch connections. --- tests/zotapi.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'tests') diff --git a/tests/zotapi.rs b/tests/zotapi.rs index 81210db..269e8d7 100644 --- a/tests/zotapi.rs +++ b/tests/zotapi.rs @@ -142,3 +142,17 @@ fn fetch_xchan_by_guid() { let _res = z.xchan().by_guid("baffebaff-baff-baff").fetch().unwrap(); m.assert(); } + +#[test] +fn fetch_connections() { + let m = mock("GET", "/api/z/1.0/abook") + .match_header("Authorization", Matcher::Regex(r"Basic \w+".into())) + .with_status(200) + .with_header("content-type", "application/json") + .with_body("{}") + .create(); + + let z = zotapi::client(&format!("http://{}", mockito::SERVER_ADDRESS), "testuser", "test1234"); + let _res = z.abook().fetch().unwrap(); + m.assert(); +} -- cgit v1.2.3