The matrix-rust-sdk uses mockito for testing the sdk. I think we can and should do something similar.
matrix-rust-sdk