示例#1
0
def test_check_branch_wrong_side(capsys, session, app, git):
    app.config['COLORS'] = False

    assert_that(message("testbranch..master", repository=git), equal_to(0))

    out, _ = capsys.readouterr()
    assert_that(out.strip(), equal_to(""))
示例#2
0
def test_check_branch_wrong_side(capsys, session, app, git):
    app.config['COLORS'] = False

    assert_that(message("testbranch..master", repository=git), equal_to(0))

    out, _ = capsys.readouterr()
    assert_that(out.strip(), equal_to(""))
示例#3
0
def test_check_branch(capsys, session, app, git):
    app.config['TRUSTED_DEVELOPERS'] = ('*****@*****.**', )
    app.config['SIGNATURES'] = ('By', )
    app.config['COMPONENTS'] = ('global', )
    app.config['COLORS'] = False

    assert_that(message("master..testbranch", repository=git), equal_to(0))

    out, _ = capsys.readouterr()
    assert_that(out.split("\n"), has_item("Everything is OK."))
示例#4
0
def test_check_branch(capsys, session, app, git):
    app.config['TRUSTED_DEVELOPERS'] = ('*****@*****.**',)
    app.config['SIGNATURES'] = ('By',)
    app.config['COMPONENTS'] = ('global',)
    app.config['COLORS'] = False

    assert_that(message("master..testbranch", repository=git), equal_to(0))

    out, _ = capsys.readouterr()
    assert_that(out.split("\n"), has_item("Everything is OK."))
示例#5
0
def test_check_head(capsys, session, app, git):
    app.config['COLORS'] = False

    assert_that(message("HEAD", repository=git), equal_to(1))

    out, _ = capsys.readouterr()
    assert_that(out.split("\n"),
                has_items("1: M110 missing component name",
                          "1: M101 signature is missing",
                          "1: M100 needs more reviewers"))
示例#6
0
def test_check_head(capsys, session, app, git):
    app.config['COLORS'] = False

    assert_that(message("HEAD", repository=git), equal_to(1))

    out, _ = capsys.readouterr()
    assert_that(
        out.split("\n"),
        has_items("1: M110 missing component name",
                  "1: M101 signature is missing",
                  "1: M100 needs more reviewers"))