3.0.ipv8.test.test_loader
Classes
Module Contents
- class 3.0.ipv8.test.test_loader.MockCommunity(settings: 3.0.ipv8.community.CommunitySettings)
Bases:
3.0.ipv8.community.CommunityEmpty community implementation.
- peer
- endpoint
- network
- kwargs
- bootstrappers = []
- class 3.0.ipv8.test.test_loader.MockWalk(community: MockCommunity, some_attribute: int)
Bases:
3.0.ipv8.peerdiscovery.discovery.DiscoveryStrategyEmpty walker with an init parameter.
- overlay
- some_attribute
- class 3.0.ipv8.test.test_loader.MockWalk2(overlay: _OT)
Bases:
3.0.ipv8.peerdiscovery.discovery.DiscoveryStrategyEmpty walker.
- class 3.0.ipv8.test.test_loader.MockBootstrapper(some_attribute: int)
Bases:
3.0.ipv8.bootstrapping.bootstrapper_interface.BootstrapperEmpty bootstrapper with an init parameter.
- some_attribute
- async initialize(overlay: 3.0.ipv8.community.Community) None
Initialize nothing.
- async get_addresses(overlay: 3.0.ipv8.community.Community, timeout: float) collections.abc.Iterable[3.0.ipv8.types.Address]
Return no addresses.
- keep_alive(overlay: 3.0.ipv8.community.Community) None
Ping nothing.
- blacklist() collections.abc.Iterable[3.0.ipv8.types.Address]
Return no blacklist.
- class 3.0.ipv8.test.test_loader.MockBootstrapper2
Bases:
3.0.ipv8.bootstrapping.bootstrapper_interface.BootstrapperEmpty bootstrapper.
- async initialize(overlay: 3.0.ipv8.community.Community) None
Initialize nothing.
- async get_addresses(overlay: 3.0.ipv8.community.Community, timeout: float) collections.abc.Iterable[3.0.ipv8.types.Address]
Return no addresses.
- keep_alive(overlay: 3.0.ipv8.community.Community) None
Ping nothing.
- blacklist() collections.abc.Iterable[3.0.ipv8.types.Address]
Return no blacklist.
- class 3.0.ipv8.test.test_loader.MockSession
Fake session object.
- launch_condition1 = True
- launch_condition2 = False
- some_attribute1 = 'I am a string :)'
- some_attribute2 = 1337
- community = None
- class 3.0.ipv8.test.test_loader.MockOverlayProvider
Fake overlay provider.
- endpoint = None
- network = None
- overlays = []
- strategies = []
- class 3.0.ipv8.test.test_loader.StagedCommunityLauncher
Bases:
3.0.ipv8.loader.CommunityLauncherCommunity launcher with some fake data.
- should_launch(session: MockSession) bool
Pull the launch conditions from our session.
- get_overlay_class() type[MockCommunity]
We run on the MockCommunity.
- get_kwargs(session: MockSession) dict[str, Any]
The keyword args to launch our community with.
- get_walk_strategies() list[tuple[type[3.0.ipv8.peerdiscovery.discovery.DiscoveryStrategy], dict, int]]
Get our walkers.
- get_bootstrappers(session: MockSession) list[tuple[type[3.0.ipv8.bootstrapping.bootstrapper_interface.Bootstrapper], dict]]
Get the bootstrappers for our community.
- finalize(ipv8: 3.0.ipv8.types.IPv8, session: MockSession, community: MockCommunity) None
Finish off our launching procedure.
- class 3.0.ipv8.test.test_loader.TestCommunityLauncher(methodName: str = 'runTest')
Bases:
3.0.ipv8.test.base.TestBaseTests related to the community launcher.
- test_not_before_list() None
Check that the not_before decorator with multiple arguments equals the not_before() definition.
- test_not_before_multiple() None
Check that multiple not_before decorators with an argument equals the not_before() definition.
- test_should_launch_single() None
Check that a validated single launch condition causes should_launch() to return True.
- test_shouldnt_launch_single() None
Check that an invalid single launch condition causes should_launch() to return False.
- test_should_launch_multiple() None
Check that a validated multiple launch conditions causes should_launch() to return True.
- test_shouldnt_launch_multiple() None
Check that an invalid condition for multiple launch conditions causes should_launch() to return False.
- test_overlay_class_from_str() None
Check if a Community string specification can be lazy-loaded through the overlay_class decorator.
- test_overlay_class_from_class() None
Check if a Community class can be lazy-loaded through the overlay_class decorator.
- test_overlay_class_from_function() None
Check if a Community class (functional representation) can be lazy-loaded through the overlay_class decorator.
- test_walk_strategy_from_str() None
Check if adding a walk strategy string specification is successful.
- test_walk_strategy_from_class() None
Check if adding a walk strategy from a DiscoveryStrategy class is successful.
- test_walk_strategy_from_function() None
Check if adding a walk strategy from a function is successful.
- test_bootstrapper_from_str() None
Check if adding a bootstrapper string specification is successful.
- test_bootstrapper_from_class() None
Check if adding a bootstrapper from a Bootstrapper class is successful.
- class 3.0.ipv8.test.test_loader.TestCommunityLoader(methodName: str = 'runTest')
Bases:
3.0.ipv8.test.base.TestBaseTests related to the community loader.