Exemplo n.º 1
0
def test_topics_to_bytes_with_uuid(uuid):
    """
    Test topics_to_bytes basic usage, specifying different uuid's.
    """
    handlers = {'topic_one': 'handler', b'topic_two': 'handler'}

    curated = topics_to_bytes(handlers, uuid=uuid)
    assert isinstance(curated, dict)

    for k, v in curated.items():
        assert isinstance(k, bytes)
        assert k.startswith(uuid + b'topic_')
        assert v == 'handler'
Exemplo n.º 2
0
def test_topics_to_bytes_with_uuid(uuid):
    """
    Test topics_to_bytes basic usage, specifying different uuid's.
    """
    handlers = {'topic_one': 'handler', b'topic_two': 'handler'}

    curated = topics_to_bytes(handlers, uuid=uuid)
    assert isinstance(curated, dict)

    for k, v in curated.items():
        assert isinstance(k, bytes)
        assert k.startswith(uuid + b'topic_')
        assert v == 'handler'
Exemplo n.º 3
0
def test_topics_to_bytes_without_uuid():
    """
    Test topics_to_bytes basic usage, without specifying a uuid.
    """
    handlers = {'topic_one': 'handler', b'topic_two': 'handler'}

    curated = topics_to_bytes(handlers)
    assert isinstance(curated, dict)

    for k, v in curated.items():
        assert isinstance(k, bytes)
        assert k.startswith(b'topic_')
        assert v == 'handler'
Exemplo n.º 4
0
def test_topics_to_bytes_without_uuid():
    """
    Test topics_to_bytes basic usage, without specifying a uuid.
    """
    handlers = {'topic_one': 'handler', b'topic_two': 'handler'}

    curated = topics_to_bytes(handlers)
    assert isinstance(curated, dict)

    for k, v in curated.items():
        assert isinstance(k, bytes)
        assert k.startswith(b'topic_')
        assert v == 'handler'