コード例 #1
0
def test_message_filter_update(msg):
    '''Tests :py:meth:`pymco.message.Message.__setitem__` maintains filter as
    a dict-like object.'''
    filter_ = message.Filter()
    msg[':filter'] = filter_
    assert msg[':filter'] == dict(filter_)
    assert isinstance(msg[':filter'], dict)
コード例 #2
0
def filter_():
    '''Creates a new :py:class:`pymco.message.Filter` instance.'''
    # Importing here since py-cov will ignore code imported on conftest files
    # imports
    from pymco import message
    return message.Filter()
コード例 #3
0
def test_message_no_filter(msg_no_filter):
    '''Tests :py:class:`pymco.message.Message` with no filter.'''
    assert dict(msg_no_filter[':filter']) == dict(message.Filter())