iblutil.tests.test_net

Classes

TestBase

Test for base network utils.

TestServices

Tests for the app.Services class

TestUDP

TestWebSockets

Test net.app.EchoProtocol with a TCP/IP transport layer

class TestBase(methodName='runTest')[source]

Bases: IsolatedAsyncioTestCase

Test for base network utils.

NB: This requires internet access.

test_parse_uri()[source]

Tests for parse_uri, validate_ip and hostname2ip

test_external_ip()[source]

Test for external_ip

test_ExpMessage()[source]

Test for ExpMessage.validate method.

test_encode()[source]

Tests for iblutil.io.net.base.Communicator.encode

test_decode()[source]

Tests for iblutil.io.net.base.Communicator.decode

async test_is_success()[source]

Tests for iblutil.io.net.base.is_success function.

class TestUDP(methodName='runTest')[source]

Bases: IsolatedAsyncioTestCase

async asyncSetUp()[source]
async test_start()[source]

Tests confirmed send via start command.

async test_callback_error()[source]

Tests behaviour when callback raises exception.

async test_on_event()[source]

Test on_event method as well as init, stop, etc.

async test_alyx()[source]

Test iblutil.io.net.app.EchoProtocol.alyx method.

async test_confirmed_send_validation()[source]

Basic tests for iblutil.io.net.app.EchoProtocol.confirmed_send exception handling.

test_communicator()[source]

Basic tests for iblutil.io.net.app.EchoProtocol, namely the role setter.

async test_receive_validation()[source]

Test for behaviour when non-standard message received.

test_connection_made_validation()[source]

Test for connection_made method

async test_awaiting_response()[source]
async test_close()[source]

Test for close/cleanup routine.

async test_on_error_received()[source]

Test for on_error_received callback.

tearDown()[source]

Hook method for deconstructing the test fixture after testing it.

class TestWebSockets(methodName='runTest')[source]

Bases: IsolatedAsyncioTestCase

Test net.app.EchoProtocol with a TCP/IP transport layer

async asyncSetUp()[source]
async test_start()[source]

Tests confirmed send via start command.

test_send_validation()[source]

Test for Communicator.send method.

test_connection_made_validation()[source]

Test for connection_made method

tearDown()[source]

Hook method for deconstructing the test fixture after testing it.

class TestServices(methodName='runTest')[source]

Bases: IsolatedAsyncioTestCase

Tests for the app.Services class

async asyncSetUp()[source]
async test_type()[source]

Test that services are immutable

async test_close()[source]

Test Services.close method

async test_assign()[source]

Tests for Services.assign_callback and Services.clear_callbacks

async test_init()[source]

Test init of services.

Unfortunately this test is convoluted due to the client and server being on the same machine.

async test_service_methods()[source]

Test start, stop, etc. methods.

For a more complete test, see test_init.

async test_sequential_signal()[source]

Test for Services._signal method with concurrent=False

tearDown()[source]

Hook method for deconstructing the test fixture after testing it.