Module tor_netdir::testnet
source · Available on crate feature
testing
only.Expand description
Support for unit tests, in this crate and elsewhere.
This module is only enabled when the testing
feature is enabled.
It is not covered by semver for the tor-netdir
crate: see notes
on construct_network
.
§Panics
These functions can panic on numerous possible internal failures: only use these functions for testing.
Structs§
- A set of builder objects for a single node.
Enums§
- An error that occurs while trying to construct a network document.
Functions§
- As
construct_custom_network()
, but return aPartialNetDir
. - As
construct_custom_netdir()
, but with aGeoipDb
. - As
construct_custom_network()
, but return aPartialNetDir
, and allow network parameter customisation. - Build a fake network with enough information to enable some basic tests.
- As
construct_network()
, but return aPartialNetDir
. - As
construct_custom_network
, but do not require a customization function. - Helper: a customization function that does nothing.
Type Aliases§
- Alias for the Result type returned by document-builder functions in this module.