Contains various utility types and macros useful for testing hyper clients.
mock_connector_in_order! macros can be used to
feed a client with preset data. That way you can control exactly what it will
see, confining the test-case to its own sandbox that way.
All types they define are public to allow them to be used in other unit-tests. Please note that integration tests cannot share their mock types anyway, as each integration test goes into its own binary.
Set it up for use in tests in
[dev-dependencies] yup-hyper-mock = "*" log = "*" # log macros are used within yup-hyper-mock
Link it into your
#[cfg(test)] #[macro_use] extern crate "yup-hyper-mock" as hyper_mock
This macro maps host URLs to a respective reply, which is given in plain-text. It ignores everything that is written to it.
This macro yields all given server replies in the order they are given. The destination host URL doesn't matter at all.
A connector which requires you to implement the