Esempio n. 1
0
def test_parse_depot_requires_end_of_negative_1():
    lines = [
        '1',
        '2.4',
        '3',
        None,
    ]

    m_stream = create_mock_stream(lines)
    with pytest.raises(parser.ParsingError):
        parser.parse_depots({}, m_stream)
Esempio n. 2
0
def test_parse_depot_with_non_int_depot_raises_ParsingException():
    lines = [
        '1',
        '2.4',
        '3',
        '-1',
        None,
    ]

    m_stream = create_mock_stream(lines)
    with pytest.raises(parser.ParsingError):
        parser.parse_depots({}, m_stream)
Esempio n. 3
0
def test_parse_depot():
    lines = [
        '1',
        '2',
        '3',
        '-1',
        None,
    ]

    m_stream = create_mock_stream(lines)
    data = {}
    parser.parse_depots(data, m_stream)

    assert data == {'DEPOT_SECTION': [1, 2, 3]}