Пример #1
0
def test_require_mapping(unknown_node: yatiml.UnknownNode,
                         unknown_scalar_node: yatiml.UnknownNode) -> None:
    unknown_node.require_mapping()
    with pytest.raises(yatiml.RecognitionError):
        unknown_scalar_node.require_mapping()
Пример #2
0
 def _yatiml_recognize(cls, node: yatiml.UnknownNode) -> None:
     node.require_mapping()
     node.require_attribute('name')
     node.require_attribute('components')
Пример #3
0
 def _yatiml_recognize(cls, node: yatiml.UnknownNode) -> None:
     # In the YAML file, a Settings is just a mapping...
     node.require_mapping()
Пример #4
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')