Пример #1
0
def test_tabletext_command_command_field_in_the_middle():
    from moler.parser import table_text
    t_text = table_text.TableText(table_text.COMMAND_KWARGS["_header_regexps"],
                                  table_text.COMMAND_KWARGS["_header_keys"],
                                  _skip='drosinsk',
                                  _finish='finisher')

    lines = table_text.COMMAND_OUTPUT.split('\n')
    result = list()
    for i in lines:
        z = t_text.parse(i)
        if z is not None:
            result.append(z)

    assert result == table_text.COMMAND_RESULT
Пример #2
0
def test_tabletext_for_emty_value_field():
    from moler.parser import table_text
    t_text = table_text.TableText(
        table_text.COMMAND_KWARGS_V4["_header_regexps"],
        table_text.COMMAND_KWARGS_V4["_header_keys"],
        _skip='drosinsk',
        _finish='finisher',
        value_splitter=r'\s+')

    lines = table_text.COMMAND_OUTPUT_V4.split('\n')
    result = list()
    for i in lines:
        z = t_text.parse(i)
        if z is not None:
            result.append(z)

    assert result == table_text.COMMAND_RESULT_V4
Пример #3
0
def test_tabletext_output_from_epcsim():
    from moler.parser import table_text
    t_text = table_text.TableText(
        table_text.COMMAND_KWARGS_V3["_header_regexps"],
        table_text.COMMAND_KWARGS_V3["_header_keys"],
        table_text.COMMAND_KWARGS_V3["_skip"],
        _finish='finisher',
        value_splitter=r'[\s\|]+')

    lines = table_text.COMMAND_OUTPUT_V3.split('\n')
    result = list()
    for i in lines:
        z = t_text.parse(i)
        if z is not None:
            result.append(z)

    assert result == table_text.COMMAND_RESULT_V3