Changeset View
Changeset View
Standalone View
Standalone View
contrib/buildbot/test/test_endpoint_backportcheck.py
Show First 20 Lines • Show All 64 Lines • ▼ Show 20 Lines | class EndpointBackportcheckTestCase(ABCBotFixture): | ||||
def test_backportCheck_hasPRs(self): | def test_backportCheck_hasPRs(self): | ||||
self.phab.differential.revision.search.return_value = test.mocks.phabricator.Result([{ | self.phab.differential.revision.search.return_value = test.mocks.phabricator.Result([{ | ||||
'id': '1234', | 'id': '1234', | ||||
'fields': { | 'fields': { | ||||
'summary': "This is a test summary\n" | 'summary': "This is a test summary\n" | ||||
# Bitcoin Core links | # Bitcoin Core links | ||||
"Backport of Core PR2345 and PR34567\n" | "Backport of Core PR2345 and PR34567\n" | ||||
"Backports with optional separators PR 2345 and PR#34567 and PR #4567\n" | |||||
"PR6789 outside of a code block `PR4567 inside a code block`\n" | "PR6789 outside of a code block `PR4567 inside a code block`\n" | ||||
"```PR4567 in a single-line code block```\n" | "```PR4567 in a single-line code block```\n" | ||||
"```\nPR4567 in a multi-line code block\n```\n" | "```\nPR4567 in a multi-line code block\n```\n" | ||||
" PR4567 in a code block using indentation\n" | " PR4567 in a code block using indentation\n" | ||||
"Another backport PR567890\n" | "Another backport PR567890\n" | ||||
# secp256k1 links | # secp256k1 links | ||||
"Backport of Secp256k1 PR23 and PR345\n" | "Backport of Secp256k1 PR23 and PR345\n" | ||||
"Backport of Secp256k1 PR 23 and PR#345 and PR #45\n" | |||||
"SECP256K1 PR678 outside of a code block `secp256k1 PR456 inside a code block`\n" | "SECP256K1 PR678 outside of a code block `secp256k1 PR456 inside a code block`\n" | ||||
"```secp256k1 PR456 in a single-line code block```\n" | "```secp256k1 PR456 in a single-line code block```\n" | ||||
"```\nsecp256k1 PR456 in a multi-line code block\n```\n" | "```\nsecp256k1 PR456 in a multi-line code block\n```\n" | ||||
" secp256k1 PR456 in a code block using indentation\n" | " secp256k1 PR456 in a code block using indentation\n" | ||||
"Another secp backport PR567", | "Another secp backport PR567", | ||||
}, | }, | ||||
}]) | }]) | ||||
response = self.post_json_with_hmac( | response = self.post_json_with_hmac( | ||||
'/backportCheck', self.headers, {'object': {'phid': '1234'}}) | '/backportCheck', self.headers, {'object': {'phid': '1234'}}) | ||||
assert response.status_code == 200 | assert response.status_code == 200 | ||||
self.phab.differential.revision.search.assert_called_with( | self.phab.differential.revision.search.assert_called_with( | ||||
constraints={'phids': ['1234']}) | constraints={'phids': ['1234']}) | ||||
calls = [mock.call(transactions=[{ | calls = [mock.call(transactions=[{ | ||||
"type": "summary", | "type": "summary", | ||||
"value": "This is a test summary\n" | "value": "This is a test summary\n" | ||||
# Bitcoin Core links | # Bitcoin Core links | ||||
"Backport of Core [[https://github.com/bitcoin/bitcoin/pull/2345 | PR2345]] and " | "Backport of Core [[https://github.com/bitcoin/bitcoin/pull/2345 | PR2345]] and " | ||||
"[[https://github.com/bitcoin/bitcoin/pull/34567 | PR34567]]\n" | "[[https://github.com/bitcoin/bitcoin/pull/34567 | PR34567]]\n" | ||||
"Backports with optional separators [[https://github.com/bitcoin/bitcoin/pull/2345 | PR2345]] and " | |||||
"[[https://github.com/bitcoin/bitcoin/pull/34567 | PR34567]] and " | |||||
"[[https://github.com/bitcoin/bitcoin/pull/4567 | PR4567]]\n" | |||||
"[[https://github.com/bitcoin/bitcoin/pull/6789 | PR6789]] outside of a code block `PR4567 inside a code block`\n" | "[[https://github.com/bitcoin/bitcoin/pull/6789 | PR6789]] outside of a code block `PR4567 inside a code block`\n" | ||||
"```PR4567 in a single-line code block```\n" | "```PR4567 in a single-line code block```\n" | ||||
"```\nPR4567 in a multi-line code block\n```\n" | "```\nPR4567 in a multi-line code block\n```\n" | ||||
" PR4567 in a code block using indentation\n" | " PR4567 in a code block using indentation\n" | ||||
"Another backport [[https://github.com/bitcoin/bitcoin/pull/567890 | PR567890]]\n" | "Another backport [[https://github.com/bitcoin/bitcoin/pull/567890 | PR567890]]\n" | ||||
# secp256k1 links | # secp256k1 links | ||||
"Backport of Secp256k1 [[https://github.com/bitcoin-core/secp256k1/pull/23 | PR23]] and " | "Backport of Secp256k1 [[https://github.com/bitcoin-core/secp256k1/pull/23 | PR23]] and " | ||||
"[[https://github.com/bitcoin-core/secp256k1/pull/345 | PR345]]\n" | "[[https://github.com/bitcoin-core/secp256k1/pull/345 | PR345]]\n" | ||||
"Backport of Secp256k1 [[https://github.com/bitcoin-core/secp256k1/pull/23 | PR23]] and " | |||||
"[[https://github.com/bitcoin-core/secp256k1/pull/345 | PR345]] and " | |||||
"[[https://github.com/bitcoin-core/secp256k1/pull/45 | PR45]]\n" | |||||
"SECP256K1 [[https://github.com/bitcoin-core/secp256k1/pull/678 | PR678]] outside of a code block `secp256k1 PR456 inside a code block`\n" | "SECP256K1 [[https://github.com/bitcoin-core/secp256k1/pull/678 | PR678]] outside of a code block `secp256k1 PR456 inside a code block`\n" | ||||
"```secp256k1 PR456 in a single-line code block```\n" | "```secp256k1 PR456 in a single-line code block```\n" | ||||
"```\nsecp256k1 PR456 in a multi-line code block\n```\n" | "```\nsecp256k1 PR456 in a multi-line code block\n```\n" | ||||
" secp256k1 PR456 in a code block using indentation\n" | " secp256k1 PR456 in a code block using indentation\n" | ||||
"Another secp backport [[https://github.com/bitcoin-core/secp256k1/pull/567 | PR567]]", | "Another secp backport [[https://github.com/bitcoin-core/secp256k1/pull/567 | PR567]]", | ||||
}], objectIdentifier='1234'), mock.call(transactions=[{ | }], objectIdentifier='1234'), mock.call(transactions=[{ | ||||
"type": "comment", | "type": "comment", | ||||
"value": "[Bot Message]\n" | "value": "[Bot Message]\n" | ||||
Show All 9 Lines |