Rebase onto master (#413/#463) requires sanctioned lock_provenance in create_pr duplicate-recheck tests. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
This commit is contained in:
@@ -9,6 +9,7 @@ from unittest.mock import patch
|
|||||||
|
|
||||||
sys.path.insert(0, str(Path(__file__).resolve().parent.parent))
|
sys.path.insert(0, str(Path(__file__).resolve().parent.parent))
|
||||||
|
|
||||||
|
import issue_lock_provenance
|
||||||
import issue_work_duplicate_gate as dup_gate
|
import issue_work_duplicate_gate as dup_gate
|
||||||
import mcp_server
|
import mcp_server
|
||||||
from issue_work_duplicate_gate import (
|
from issue_work_duplicate_gate import (
|
||||||
@@ -172,11 +173,23 @@ class TestMcpDuplicateRecheck(unittest.TestCase):
|
|||||||
self._dir.cleanup()
|
self._dir.cleanup()
|
||||||
|
|
||||||
def _write_lock(self, issue_number=400, branch="feat/issue-400-x"):
|
def _write_lock(self, issue_number=400, branch="feat/issue-400-x"):
|
||||||
|
work_lease = {
|
||||||
|
"operation_type": "author_issue_work",
|
||||||
|
"issue_number": issue_number,
|
||||||
|
"branch": branch,
|
||||||
|
"claimant": {"username": "test-user", "profile": "test-author"},
|
||||||
|
"expires_at": "2999-01-01T00:00:00Z",
|
||||||
|
}
|
||||||
with open(self.lock_path, "w", encoding="utf-8") as fh:
|
with open(self.lock_path, "w", encoding="utf-8") as fh:
|
||||||
json.dump({
|
json.dump({
|
||||||
"issue_number": issue_number,
|
"issue_number": issue_number,
|
||||||
"branch_name": branch,
|
"branch_name": branch,
|
||||||
"remote": "prgs",
|
"remote": "prgs",
|
||||||
|
"work_lease": work_lease,
|
||||||
|
"lock_provenance": issue_lock_provenance.build_sanctioned_lock_provenance(
|
||||||
|
tool="gitea_lock_issue",
|
||||||
|
claimant=work_lease.get("claimant"),
|
||||||
|
),
|
||||||
}, fh)
|
}, fh)
|
||||||
|
|
||||||
@patch("mcp_server._assess_issue_duplicate_gate")
|
@patch("mcp_server._assess_issue_duplicate_gate")
|
||||||
|
|||||||
Reference in New Issue
Block a user