Publish curated ITWorx_MCP_Hub source from 7fde2770ba344c684b7e7a6b74f763dc19e7c560
This commit is contained in:
1 parent
18cf749bf5
commit
89703431af
11 files changed
+1247
-114
No files matched your search
@@ -2,8 +2,6 @@
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from unittest.mock import patch
|
||||
|
||||
import pytest
|
||||
|
||||
from packages.connector_kit import GiteaError, PageRequest
|
||||
@@ -66,30 +64,17 @@ def test_merge_uses_status_linked_run_when_actions_wrapper_is_empty() -> None:
|
||||
def test_merge_accepts_exact_head_managed_run_when_gitea_omits_workflow_id() -> None:
|
||||
connector_instance, fixture = connector()
|
||||
_add_validated_head_branch(fixture)
|
||||
original_action_runs = connector_instance.client.action_runs
|
||||
|
||||
def action_runs_without_workflow_id(*args, **kwargs):
|
||||
return [
|
||||
{key: value for key, value in run.items() if key != "workflow_id"}
|
||||
for run in original_action_runs(*args, **kwargs)
|
||||
]
|
||||
|
||||
fixture._action_run.pop("workflow_id")
|
||||
try:
|
||||
with patch.object(
|
||||
connector_instance.client,
|
||||
"action_runs",
|
||||
side_effect=action_runs_without_workflow_id,
|
||||
):
|
||||
review = connector_instance.change_review(
|
||||
context(), "hub-repository", "codex/workflows"
|
||||
)["data"]
|
||||
assert review["readyToMerge"] is True
|
||||
assert review["validationRuns"][0]["id"] > 0
|
||||
assert review["validationRuns"][0]["workflowId"] == ""
|
||||
|
||||
merged = connector_instance.pull_request_merge(
|
||||
context(), "hub-repository", 7, "e" * 40, "squash"
|
||||
)["data"]
|
||||
review = connector_instance.change_review(context(), "hub-repository", "codex/workflows")[
|
||||
"data"
|
||||
]
|
||||
assert review["readyToMerge"] is True
|
||||
assert review["validationRuns"][0]["id"] > 0
|
||||
assert review["validationRuns"][0]["workflowId"] == ""
|
||||
merged = connector_instance.pull_request_merge(
|
||||
context(), "hub-repository", 7, "e" * 40, "squash"
|
||||
)["data"]
|
||||
|
||||
assert merged["merged"] is True
|
||||
assert merged["validationRunId"] > 0
|
||||
|
||||
Reference in new issue
Block a user