Esempio n. 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(""))
Esempio n. 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(""))
Esempio n. 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."))
Esempio n. 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."))
Esempio n. 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"))
Esempio n. 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"))