Add a test framework for the path selection algorithm
DirPathBuilder.pick_path
and ExitPathBuilder.pick_path
currently lack tests. Ideally, we would want to add some way to test these methods against various network topology and check the selected paths.
What I thought of, so far:
- mock DirInfo and most of the objects it references,
- create a consensus document from a human readable description of the network and then parse it into a DirInfo,
- instantiate a full DirInfo using code to help us do that.
The testing category on crates.io is worth investigating.
Anyway, this issue is mostly for collecting ideas for now, so if you have any, or even a suggestion of what should be done exactly, let's hear it. :)