rust-teos icon indicating copy to clipboard operation
rust-teos copied to clipboard

Build MockServer endpoints using base_url() instead of address()

Open sr-gi opened this issue 2 years ago • 0 comments

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()

sr-gi avatar Jun 08 '22 08:06 sr-gi