@@ -328,6 +328,41 @@ async def test_not_valid_maintenance_branch_pr_title(action):
328
328
assert post [1 ]['target_url' ] == 'https://devguide.python.org/committing/#backport-pr-title'
329
329
330
330
331
+ @pytest .mark .parametrize ('action' , ['opened' , 'reopened' , 'edited' , 'synchronize' ])
332
+ async def test_not_maintenance_branch_pr_title (action ):
333
+ title = 'Fix some typo'
334
+ data = {
335
+ 'action' : action ,
336
+ 'number' : 2248 ,
337
+ 'pull_request' : {
338
+ 'title' : title ,
339
+ 'body' : '' ,
340
+ 'issue_url' : 'https://api.github.com/issue/2248' ,
341
+ 'base' : {
342
+ 'ref' : 'gh-1234/dependent-change' ,
343
+ },
344
+ 'statuses_url' : 'https://api.github.com/repos/python/cpython/statuses/somehash' ,
345
+ },
346
+ 'repository' : {'issues_url' : 'https://api.github.com/issue{/number}' },
347
+ 'changes' : {'title' : title },
348
+ }
349
+ event = sansio .Event (data , event = 'pull_request' ,
350
+ delivery_id = '1' )
351
+ getitem = {
352
+ 'https://api.github.com/issue/1234' :
353
+ {'labels' : [{'name' : 'CLA signed' }]},
354
+ 'https://api.github.com/issue/2248' : {},
355
+ }
356
+ gh = FakeGH (getitem = getitem )
357
+ await backport .router .dispatch (event , gh )
358
+ post = gh .post_ [0 ]
359
+ assert post [0 ] == 'https://api.github.com/repos/python/cpython/statuses/somehash'
360
+ assert not any (
361
+ post_item ['context' ] == 'bedevere/maintenance-branch-pr'
362
+ for post_item in post
363
+ )
364
+
365
+
331
366
@pytest .mark .parametrize ('action' , ['opened' , 'reopened' , 'edited' , 'synchronize' ])
332
367
async def test_maintenance_branch_pr_status_not_posted_on_main (action ):
333
368
title = 'Fix some typo'
0 commit comments