rust-teos
rust-teos copied to clipboard
Build MockServer endpoints using base_url() instead of address()
httpmock::MockServer
is being used in several tests throughout the codebase when interaction with the http API is needed for testing purposes.
Currently, addresses to connect to the mocked server are built on the lines of :
let server = MockServer::start();
[...]
endpoint = format!("http://{}", server.address())
This can be simplified by using the base_url()
method:
endpoint = server.base_url()