示例#1
0
def test_map_multiple_steps():
    """Check if mapping multiple steps works."""
    assert map_steps(MULTIPLE_STEPS, MULTIPLE_EXPECTEDRESULTS) == [
        ("<p>First step</p>", "<p>First step expected result.</p>"),
        ("<p>Second step</p>", "<p>Second step expected result.</p>"),
        ("<p>Third step</p>", "<p>Third step expected result.</p>"),
    ]
示例#2
0
def test_get_multiple_steps_diff_items():
    multiple_steps = '\n'.join(MULTIPLE_STEPS.splitlines()[:-1])
    assert map_steps(
        multiple_steps, MULTIPLE_EXPECTEDRESULTS) == [(
            RST_PARSER.parse(multiple_steps),
            RST_PARSER.parse(MULTIPLE_EXPECTEDRESULTS),
        )]
示例#3
0
def test_get_multiple_steps_diff_items():
    """Check if parsing multiple steps of different items works."""
    multiple_steps = '\n'.join(MULTIPLE_STEPS.splitlines()[:-1])
    assert map_steps(multiple_steps, MULTIPLE_EXPECTEDRESULTS) == [(
        RST_PARSER.parse(multiple_steps),
        RST_PARSER.parse(MULTIPLE_EXPECTEDRESULTS),
    )]
示例#4
0
def test_map_multiple_steps():
    """Check if mapping multiple steps works."""
    assert map_steps(MULTIPLE_STEPS, MULTIPLE_EXPECTEDRESULTS) == [
        ('<p>First step</p>', '<p>First step expected result.</p>'),
        ('<p>Second step</p>', '<p>Second step expected result.</p>'),
        ('<p>Third step</p>', '<p>Third step expected result.</p>'),
    ]
示例#5
0
def test_map_steps_parse_error():
    """Check if mapping multiple steps with a parse error works."""
    multiple_steps = MULTIPLE_STEPS.replace('. ', '.', 1)
    assert map_steps(multiple_steps, MULTIPLE_EXPECTEDRESULTS) == [(
        RST_PARSER.parse(multiple_steps),
        RST_PARSER.parse(MULTIPLE_EXPECTEDRESULTS),
    )]
示例#6
0
def test_get_multiple_steps_diff_items():
    """Check if parsing multiple steps of different items works."""
    multiple_steps = '\n'.join(MULTIPLE_STEPS.splitlines()[:-2] + ['</ol>\n'])
    assert map_steps(multiple_steps, MULTIPLE_EXPECTEDRESULTS) == [
        ('<ol>\n  <li><p>First step</p></li>\n  '
         '<li><p>Second step</p></li>\n</ol>\n', MULTIPLE_EXPECTEDRESULTS)
    ]
示例#7
0
def test_map_steps_parse_error():
    """Check if mapping multiple steps with a parse error works."""
    multiple_steps = MULTIPLE_STEPS.replace('. ', '.', 1)
    assert map_steps(multiple_steps, MULTIPLE_EXPECTEDRESULTS) == [(
        RST_PARSER.parse(multiple_steps),
        RST_PARSER.parse(MULTIPLE_EXPECTEDRESULTS),
    )]
示例#8
0
def test_get_multiple_steps_diff_items():
    """Check if parsing multiple steps of different items works."""
    multiple_steps = '\n'.join(MULTIPLE_STEPS.splitlines()[:-1])
    assert map_steps(
        multiple_steps, MULTIPLE_EXPECTEDRESULTS) == [(
            RST_PARSER.parse(multiple_steps),
            RST_PARSER.parse(MULTIPLE_EXPECTEDRESULTS),
        )]
示例#9
0
def test_map_single_step():
    """Check if mapping single step works."""
    assert map_steps(SINGLE_STEP, SINGLE_EXPECTEDRESULT) == [
        (u"<p>Single step</p>", "<p>Single step expected result.</p>")
    ]
示例#10
0
def test_map_steps_parse_error():
    multiple_steps = MULTIPLE_STEPS.replace('. ', '.', 1)
    assert map_steps(multiple_steps, MULTIPLE_EXPECTEDRESULTS) == [(
        RST_PARSER.parse(multiple_steps),
        RST_PARSER.parse(MULTIPLE_EXPECTEDRESULTS),
    )]
示例#11
0
def test_map_multiple_steps():
    assert map_steps(MULTIPLE_STEPS, MULTIPLE_EXPECTEDRESULTS) == [
        ('<p>First step</p>', '<p>First step expected result.</p>'),
        ('<p>Second step</p>', '<p>Second step expected result.</p>'),
        ('<p>Third step</p>', '<p>Third step expected result.</p>'),
    ]
示例#12
0
def test_map_single_step():
    assert map_steps(SINGLE_STEP, SINGLE_EXPECTEDRESULT) == [
        (u'<p>Single step</p>', '<p>Single step expected result.</p>')
    ]
示例#13
0
def test_map_single_step():
    """Check if mapping single step works."""
    assert map_steps(SINGLE_STEP, SINGLE_EXPECTEDRESULT) == [
        (u'<p>Single step</p>', '<p>Single step expected result.</p>')
    ]
示例#14
0
def test_map_single_step():
    """Check if mapping single step works."""
    mapped = [(SINGLE_STEP, SINGLE_EXPECTEDRESULT)]
    assert map_steps(SINGLE_STEP, SINGLE_EXPECTEDRESULT) == mapped