ic-pocket-canister-runtime
Implementation of the ic_canister_runtime crate's Runtime trait for PocketIC allowing to mock
HTTPs outcalls.
Usage
Add this to your Cargo.toml (see crates.io for the latest version):
= "0.1.0"
= "0.1.0"
Then, use the library to mock HTTP outcalls for canister deployed with PocketIC, as follows:
use Runtime;
use ;
use PocketIc;
let mocks = new
.given
.respond_with;
let pocket_ic = new.await;
let runtime = new
.with_http_mocks;
let http_request_result: String = runtime
.update_call
.await
.expect;
assert!;
assert!;
See the Rust documentation for more details.
License
This project is licensed under the Apache License 2.0.