Exemplo n.º 1
0
def test_require_attribute_value(unknown_node: yatiml.UnknownNode) -> None:
    unknown_node.require_attribute_value('attr1', 42)
    with pytest.raises(yatiml.RecognitionError):
        unknown_node.require_attribute_value('attr1', 43)
    with pytest.raises(yatiml.RecognitionError):
        unknown_node.require_attribute_value('attr1', 'test')
    with pytest.raises(yatiml.RecognitionError):
        unknown_node.require_attribute_value('non_existent_attribute', 'test')
Exemplo n.º 2
0
 def yatiml_recognize(cls, node: yatiml.UnknownNode) -> None:
     node.require_attribute_value('subclass', 'B2')
Exemplo n.º 3
0
 def _yatiml_recognize(cls, node: yatiml.UnknownNode) -> None:
     node.require_mapping()
     node.require_attribute('ymmsl_version')
     node.require_attribute_value('ymmsl_version', 'v0.1')