示例#1
0
def test_from_namespace_non_existent_namespace():
    """Validate we raise an error if we try to create a compound from a namespace that does not exist."""
    with pytest.raises(ValueError) as error:
        from_namespace("a_namespace_that_do_not_exist")

    assert (str(error.value) ==
            "Namespace 'a_namespace_that_do_not_exist' does not exist.")
示例#2
0
def test_from_namespace_node_name():
    """
    Validate we raise an error if we try to create a compound from a namespace
    used by a node name.
    """
    with pytest.raises(ValueError) as error:
        from_namespace("a")

    assert str(error.value) == "A node is already named 'a'"
示例#3
0
def test_from_namespace_missing_output():
    """Validate we raise an error if try to crete a compound from a namespace without the output node."""
    cmds.namespace(addNamespace=":a")
    cmds.createNode("transform", name=":a:outputs")

    with pytest.raises(ComponentValidationError) as error:
        from_namespace("a")

    assert str(error.value) == "'a:inputs' don't exist."