コード例 #1
0
def test_get_raw_paragraphs_correct_content():
    data = examples.CONTROL_FILE_DATA
    raw_paragraphs = paragraphs.get_raw_paragraphs(data)

    assert raw_paragraphs, 'no paragraphs found, check correct_count tests'
    first_paragraph = raw_paragraphs[0]

    assert first_paragraph.startswith('Source: nginx')
    assert first_paragraph.endswith('Homepage: http://nginx.net')

    last_paragraph = raw_paragraphs[-1]
    assert last_paragraph.startswith('Package: nginx-doc')
    assert last_paragraph.endswith('power of Nginx.')
コード例 #2
0
def test_get_raw_paragraphs_correct_count_with_linebreaks():
    data = examples.CONTROL_FILE_DATA
    raw_paragraph = paragraphs.get_raw_paragraphs(data)
    assert len(raw_paragraph) == 3
コード例 #3
0
def test_get_raw_paragraphs_correct_count_stripped_content():
    data = examples.CONTROL_FILE_DATA.strip()
    raw_paragraph = paragraphs.get_raw_paragraphs(data)
    assert len(raw_paragraph) == 3