Skip to main content

test-eventbus-bridge

A vertx eventbus bridge that is used for testing

How to used it

Install using pip:

pip install vertx-eventbus-bridge-starter

import unittest
from testeventbus import EventBusBridgeStarter, CountDownLatch
from vertx import EventBus


class EventBusClientTests(unittest.TestCase):
    """
    This is the tests against a local test eventbus bridge
    """

    starter = None

    def __init__(self, *args, **kwargs):
        super(EventBusClientTests, self).__init__(*args, **kwargs)
    
    @classmethod
    def setUpClass(cls):
        print("Start EventBus Bridge")
        cls.starter = EventBusBridgeStarter(debug=True)
        cls.starter.start()
        cls.starter.wait_started()
        print("yes, Bridge started !!")
    
    @classmethod
    def tearDownClass(cls):
        print("Now stop the bridge")
        cls.starter.stop()
    
    def test_send(self):
        latch = CountDownLatch()
        ebus = EventBus()
        ebus.connect()
    
        def handler(message):
            self.assertEqual(message['body']['hello'], 'world')
            ebus.close()
            latch.count_down()
        ebus.register_handler('echo-back', handler)
        ebus.send("echo", reply_address="echo-back", body={"hello": "world"})
        latch.awaits(5)

TODO

Metadata

Release files for vertx-eventbus-bridge-starter 1.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for vertx-eventbus-bridge-starter 1.0.3
File Size Uploaded
vertx-eventbus-bridge-starter-1.0.3.tar.gz 3.6 kB Details

Release files / vertx-eventbus-bridge-starter-1.0.3.tar.gz

Download URL vertx-eventbus-bridge-starter-1.0.3.tar.gz
Size 3.6 kB
Tags Source
SHA-256 checksum
How to use checksums
944c646a6cac4f2b89371c2b12cd5598a49ad3d3245cbd70f5fbf54cbd877ab2
BLAKE2b-256 checksum
How to use checksums
4ed6fc47fc6e50f313a804d966a6921bd57afaef75dcaaac41ecc6cad43bf2b5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0.post20210125 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.7.0

Release history Release notifications | RSS feed

This release

1.0.3 This release

1 release file

1.0.2

1 release file

1.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page