Merge "Support merged as requirement in github driver"

This commit is contained in:
Zuul
2018-06-01 21:42:02 +00:00
committed by Gerrit Code Review
6 changed files with 72 additions and 3 deletions

View File

@@ -72,6 +72,22 @@ class TestGithubDriver(ZuulTestCase):
self.assertEqual(2, len(self.history))
# now emit closed event without merging
self.fake_github.emitEvent(A.getPullRequestClosedEvent())
self.waitUntilSettled()
# nothing should have happened due to the merged requirement
self.assertEqual(2, len(self.history))
# now merge the PR and emit the event again
A.setMerged('merged')
self.fake_github.emitEvent(A.getPullRequestClosedEvent())
self.waitUntilSettled()
# post job must be run
self.assertEqual(3, len(self.history))
@simple_layout('layouts/files-github.yaml', driver='github')
def test_pull_matched_file_event(self):
A = self.fake_github.openFakePullRequest(