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§
- Node
Builders - A set of builder objects for a single node.
Enums§
- Build
Error - An error that occurs while trying to construct a network document.
Functions§
- construct_
custom_ netdir - As
construct_custom_network()
, but return aPartialNetDir
. - construct_
custom_ netdir_ with_ geoip geoip
- As
construct_custom_netdir()
, but with aGeoipDb
. - construct_
custom_ netdir_ with_ params - As
construct_custom_network()
, but return aPartialNetDir
, and allow network parameter customisation. - construct_
custom_ network - Build a fake network with enough information to enable some basic tests.
- construct_
netdir - As
construct_network()
, but return aPartialNetDir
. - construct_
network - As
construct_custom_network
, but do not require a customization function. - simple_
net_ func - Helper: a customization function that does nothing.
Type Aliases§
- Build
Result - Alias for the Result type returned by document-builder functions in this module.