Пример #1
0
def test_render_dictionnary_bad_bool_dependency():
    nodes_rendering_order['bad_bool_dependency'] = [('bool', True, True)]
    with pytest.raises(NotImplementedError) as e:
        list(render({'type': 'bad_bool_dependency'}))
    assert str(
        e.value
    ) == "Bool keys are only used for dependency, they cannot be rendered. Please set the \"('bool', True, True)\"'s dependent key in \"bad_bool_dependency\" node to False"
Пример #2
0
def test_render_dictionnary_bad_type():
    nodes_rendering_order['bad_type'] = [('wtf', 'hello', True)]
    with pytest.raises(NotImplementedError) as e:
        list(render({'type': 'bad_type'}))
    assert str(e.value) == "Unknown key type \"wtf\" in \"bad_type\" node"
Пример #3
0
def test_render_crap():
    with pytest.raises(NotImplementedError):
        render("crap")
Пример #4
0
def test_render_dictionnary_bad_bool_dependency2():
    nodes_rendering_order['bad_bool_dependency2'] = [('bool', False, 'other_key')]
    with pytest.raises(NotImplementedError) as e:
        list(render({'type': 'bad_bool_dependency2'}))
    assert str(e.value) == "Bool keys are only used for dependency, they cannot be rendered. Please set the \"('bool', False, 'other_key')\"'s dependent key in \"bad_bool_dependency2\" node to False"
Пример #5
0
def test_render_dictionnary_bad_type():
    nodes_rendering_order['bad_type'] = [('wtf', 'hello', True)]
    with pytest.raises(NotImplementedError) as e:
        list(render({'type': 'bad_type'}))
    assert str(e.value) == "Unknown key type \"wtf\" in \"bad_type\" node"
Пример #6
0
def test_render_crap():
    with pytest.raises(NotImplementedError):
        render("crap")