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)
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()
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())