tests package

Submodules

tests.test_eventbus module

Created on 2020-02-01

@author: wf

class tests.test_eventbus.EchoCommand(cmd, msgType, address)[source]

Bases: dict

an Echo Command object

__init__(cmd, msgType, address)[source]

construct me

Parameters:
  • cmd (str) – a command either “time” or “counter”
  • msgType (str) – a message type either “send” or “publish”
  • address (str) – an address to be used for the echo
asJson()[source]

return me as a json String

Returns:the json representation of the EchoCommand
Return type:str
class tests.test_eventbus.Handler(debug=False)[source]

Bases: object

a Handler for messages

__init__(debug=False)[source]

construct me

Parameters:debug (bool) – if True show debug messages - default: True
handle(err, message=None)[source]

handle the given vert.x tcp-event bus message

Parameters:
  • err (dict) – potential error message
  • message (dict) – the message dict to handle
  • may contain a body and headers (it) –
class tests.test_eventbus.TestEventbus(*args, **kwargs)[source]

Bases: unittest.case.TestCase

test the Eventbus for the vert.x tcp eventbus bridge

__init__(*args, **kwargs)[source]

construct me

classmethod setUpClass()[source]

Hook method for setting up class fixture before running tests in the class.

classmethod tearDownClass()[source]

Hook method for deconstructing the class fixture after running all tests in the class.

testCmd()[source]

test json encoding of a Cmd

testCreateWithInvalidPort()[source]

test creating an event bus for an invalid port

testHandler()[source]

test handler

testMergeHeaders()[source]

test merging headers

testRegisterHandler()[source]

test a successful handler registration

testRegisterWithClosedBus()[source]

try registering an event bus for a closed port

testSocketDirect()[source]

test direct socket communication with echo server

testSocketOfEventBus()[source]

send a message using the private function of the event bus

testTcpEventBusBridgeStarter()[source]

test the TcpEventBusBridgeStarter

testWait()[source]

test waiting for the eventbus to open and close

test_ping()[source]

test sending a ping

test_publish()[source]

test publishing a message to the echo server

test_publishWithHeader()[source]

test publishing a message with headers

test_publishWithMultipleHandlers()[source]

test publishing a message to be handle by multiple handlers

test_registerHandler()[source]

test registering a handler

test_reply()[source]

test sending a message with a reply handler

test_send()[source]

test sending a message

test_sendInvalidAddress()[source]

test trying to send to an invalid address

Module contents