def test_applies_multiline_substitution():
    """Correctly applies a substitution that is multiline."""
    raw = 'foo\n\n\n    bar something\n\n\n  the end'
    subbed = 'foo\n    bar something\n  the end'
    pattern = '\n\n\n'
    replacement = '\n'
    sub = substitute.Substitution(pattern, replacement, True)

    actual = sub.apply_and_get_result(raw)
    assert actual == subbed
Correctly applies a substitution that is multiline.
test/substitute_test.py