def test_to_dict_with_message_obj():
    content = Message(a={"a": {"foo": {"bar": [{"bat": []}]}}})
    _dict = content.to_dict(lev=0)
    content_fixture = {"a": {"a": {"foo": {"bar": [{"bat": []}]}}}}
    assert _dict == content_fixture
def test_to_dict_with_raw_types():
    msg = Message(c_default=[])
    content_fixture = {"c_default": []}
    _dict = msg.to_dict(lev=1)
    assert _dict == content_fixture
Example #3
0
def test_to_dict_with_message_obj():
    content = Message(a={'a': {'foo': {'bar': [{'bat': []}]}}})
    _dict = content.to_dict(lev=0)
    content_fixture = {'a': {'a': {'foo': {'bar': [{'bat': []}]}}}}
    assert _dict == content_fixture