async def test_on_check_suite_valid_branch_in_progress(mocker): mock_merge_bot_functions(mocker) branch = make_merge_bot_branch(42, "12.0", "toto") sha = "1" * 40 data = create_test_data(branch, "in_progress", "success", sha) event = EventMock(data) await on_check_suite.on_check_suite(event, None) on_check_suite.merge_bot_status.delay.assert_not_called()
async def test_on_check_suite_valid_branch(mocker): mock_merge_bot_functions(mocker) branch = make_merge_bot_branch(42, "12.0", "toto") sha = "1" * 40 data = create_test_data(branch, "completed", "failure", sha) event = EventMock(data) await on_check_suite.on_check_suite(event, None) on_check_suite.merge_bot_status.delay.assert_called_once_with( "OCA", "some-repo", branch, sha)
def test_make_merge_bot_branch(): assert (make_merge_bot_branch( "100", "12.0", "toto", "patch") == "12.0-ocabot-merge-pr-100-by-toto-bump-patch")
def test_merge_bot_branch_name(): # ocabot-merge must not change, as other tools may depend on it. # The rest of the branch name must be considered opaque and fit for the bot # needs only. assert "ocabot-merge" in make_merge_bot_branch("100", "12.0", "toto", "patch")
def test_make_merge_bot_branch(): assert (make_merge_bot_branch( "100", "12.0", "toto") == "ocabot-merge-pr-100-to-12.0-by-toto")