Example #1
0
def test_dict_parser_config_2():
    """Tests that a parser config with dict specs is correctly expanded"""
    config = {"option": {"size": {"left": False}}}

    actual = _expand_parser_config(config)
    expected = {
        "option": {
            "size": {
                "left": False,
                "right": True,
                "min_instances": 0,
                "max_instances": None,
                "precedence": "left",
                "linking_words": frozenset(),
            }
        }
    }

    assert actual == expected
Example #2
0
def test_dict_parser_config_2():
    """Tests that a parser config with dict specs is correctly expanded"""
    config = {'option': {'size': {'left': False}}}

    actual = _expand_parser_config(config)
    expected = {
        'option': {
            'size': {
                'left': False,
                'right': True,
                'min_instances': 0,
                'max_instances': None,
                'precedence': 'left',
                'linking_words': frozenset()
            }
        }
    }

    assert actual == expected