2. cc_example

2.1. Virtual Communication Channel for tests

module

cc_example

class pykiso.lib.connectors.cc_example.CCExample(name=None, **kwargs)[source]

Only use for development purpose.

This channel simply handle basic TestApp response mechanism.

Initialize attributes.

Parameters

name (Optional[str]) – name of the communication channel

_cc_close()[source]

Close the channel.

Return type

None

_cc_open()[source]

Open the channel.

Return type

None

_cc_receive(timeout=0.1, raw=False)[source]

Reads from the channel - decorator usage for test.

Parameters
  • timeout (float) – not use

  • raw (bool) – if raw is false serialize it using Message serialize.

Raises

NotImplementedError – receiving raw bytes is not supported.

Return type

Dict[str, Optional[Message]]

Returns

Message if successful, otherwise None

_cc_send(msg, raw=False)[source]

Sends the message on the channel.

Parameters
  • msg (Message) – message to send, should be Message type like.

  • raw (bool) – if raw is false serialize it using Message serialize.

Raises

NotImplementedError – sending raw bytes is not supported.

Return type

None