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
def whitelist(db): w = Whitelist() w.db = db return w