コード例 #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'
コード例 #2
0
ファイル: test_common.py プロジェクト: Peque/osbrain
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'
コード例 #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'
コード例 #4
0
ファイル: test_common.py プロジェクト: Peque/osbrain
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'