def test_text_report_delta__colorize_True__with_missing_range():
    from pycobertura.reporters import TextReporterDelta
    cobertura1 = make_cobertura('tests/dummy.source1/coverage.xml')
    cobertura2 = make_cobertura('tests/dummy.source2/coverage.xml')
    report_delta = TextReporterDelta(cobertura1, cobertura2, color=True)
    assert (report_delta.generate() == 'Filename         Stmts      Miss  Cover    Missing\n---------------  -------  ------  -------  ----------\ndummy/dummy.py   -            \x1b[32m-2\x1b[39m  +40.00%  \x1b[32m-5\x1b[39m, \x1b[32m-6\x1b[39m\ndummy/dummy2.py  +2           \x1b[31m+1\x1b[39m  -25.00%  \x1b[32m-2\x1b[39m, \x1b[32m-4\x1b[39m, \x1b[31m+5\x1b[39m\ndummy/dummy3.py  +2           \x1b[31m+2\x1b[39m  -        \x1b[31m+1\x1b[39m, \x1b[31m+2\x1b[39m\nTOTAL            +4           \x1b[31m+1\x1b[39m  +31.06%')
def test_text_report_delta__colorize_True__with_missing_range():
    from pycobertura.reporters import TextReporterDelta
    cobertura1 = make_cobertura('tests/dummy.source1/coverage.xml')
    cobertura2 = make_cobertura('tests/dummy.source2/coverage.xml')
    report_delta = TextReporterDelta(cobertura1, cobertura2, color=True)
    assert (report_delta.generate() == 'Filename         Stmts      Miss  Cover    Missing\n---------------  -------  ------  -------  ----------\ndummy/dummy.py   -            \x1b[32m-2\x1b[39m  +40.00%  \x1b[32m-5\x1b[39m, \x1b[32m-6\x1b[39m\ndummy/dummy2.py  +2           \x1b[31m+1\x1b[39m  -25.00%  \x1b[32m-2\x1b[39m, \x1b[32m-4\x1b[39m, \x1b[31m+5\x1b[39m\ndummy/dummy3.py  +2           \x1b[31m+2\x1b[39m  -        \x1b[31m+1\x1b[39m, \x1b[31m+2\x1b[39m\nTOTAL            +4           \x1b[31m+1\x1b[39m  +31.06%')