diff options
author | Harald Eilertsen <haraldei@anduin.net> | 2018-09-23 19:08:06 +0200 |
---|---|---|
committer | Harald Eilertsen <haraldei@anduin.net> | 2018-09-23 19:38:50 +0200 |
commit | f50dfd5045170e1435270e6de3a03a74807ee392 (patch) | |
tree | 3a4a4185cecf54186f7c549243e16f5d5cfe7705 /tests | |
parent | 5b740a7a2a50f049619797c9e4fcd7815fea259e (diff) | |
download | rust-zotapi-f50dfd5045170e1435270e6de3a03a74807ee392.tar.gz rust-zotapi-f50dfd5045170e1435270e6de3a03a74807ee392.tar.bz2 rust-zotapi-f50dfd5045170e1435270e6de3a03a74807ee392.zip |
Begin implementaton of undocumented abook api to fetch connections.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/zotapi.rs | 14 |
1 files changed, 14 insertions, 0 deletions
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(); +} |