latest.ipv8.test.messaging.interfaces.lan_addresses.test_importshield

Module Contents

Classes

SegfaultingImporter

Importer that causes segfaults, scary!

TestImportShield

Tests relating to the import shield.

class latest.ipv8.test.messaging.interfaces.lan_addresses.test_importshield.SegfaultingImporter

Bases: importlib.abc.MetaPathFinder

Importer that causes segfaults, scary!

find_module(fullname: str, path: str) SegfaultingImporter | None

Only serve imports from this class called “killer_import”, as a safety feature.

load_module(_: str) None

Cause a segfault when the module is actually loaded.

We cannot simply raise an AssertionError here, as the import protection SHOULD also serve as a general try: ... except Exception: ... handler.

class latest.ipv8.test.messaging.interfaces.lan_addresses.test_importshield.TestImportShield(methodName: str = 'runTest')

Bases: latest.ipv8.test.base.TestBase

Tests relating to the import shield.

test_stop_import() None

Check that segfaulting imports are properly ignored when the platform does not match.

test_allow_import() None

Check that allowed imports are actually imported.

test_allow_import_log_exception() None

Check that allowed imports are actually imported.