Module 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§

NodeBuilders
A set of builder objects for a single node.

Enums§

BuildError
An error that occurs while trying to construct a network document.

Functions§

construct_custom_netdir
As construct_custom_network(), but return a PartialNetDir.
construct_custom_netdir_with_geoipgeoip
As construct_custom_netdir(), but with a GeoipDb.
construct_custom_netdir_with_params
As construct_custom_network(), but return a PartialNetDir, 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 a PartialNetDir.
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§

BuildResult
Alias for the Result type returned by document-builder functions in this module.