예제 #1
0
def test_check_and_report(event, should_pass):
    w = Whitelist()
    w.db = {
        "anakin": {
            "status": "approved_manually"
        },
        "yoda": {
            "status": "approved_manually"
        },
        "naboo": {
            "status": "approved_manually"
        },
    }

    flexmock(
        GithubProject,
        pr_comment=lambda *args, **kwargs: None,
        set_commit_status=lambda *args, **kwargs: None,
        issue_comment=lambda *args, **kwargs: None,
    )
    git_project = GithubProject("", GithubService(), "")
    assert w.check_and_report(event, git_project) == should_pass
예제 #2
0
def whitelist(db):
    w = Whitelist()
    w.db = db
    return w