From c41cac7b562451512c23640998c0edbd71e72633 Mon Sep 17 00:00:00 2001 From: Marvin Pohl Date: Tue, 27 Oct 2020 02:00:48 +0100 Subject: [PATCH] Swapped order of hooks from oldest to newest to accomodate for fixed commit order. --- buildbot_gitea/test/test_webhook.py | 33 +++++++++++++++-------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/buildbot_gitea/test/test_webhook.py b/buildbot_gitea/test/test_webhook.py index c3a978c..a231fd1 100644 --- a/buildbot_gitea/test/test_webhook.py +++ b/buildbot_gitea/test/test_webhook.py @@ -733,22 +733,6 @@ class TestChangeHookGiteaPush(unittest.TestCase, TestReactorMixin): change = self.changeHook.master.data.updates.changesAdded[0] self.assertEqual(change['repository'], 'ssh://git@git.example.com/max/webhook_test.git') - self.assertEqual( - change["author"], "Max Mustermann ") - self.assertEqual( - change["revision"], '9d7157cc4a137b3e1dfe92750ccfb1bbad239f99') - self.assertEqual( - change["when_timestamp"], - 1536063014) - self.assertEqual( - change["comments"], "TestBranch\n") - self.assertEqual(change["branch"], "feature-branch") - self.assertEqual(change[ - "revlink"], - "https://git.example.com/max/webhook_test/commit/9d7157cc4a137b3e1dfe92750ccfb1bbad239f99") - change = self.changeHook.master.data.updates.changesAdded[1] - self.assertEqual(change['repository'], 'ssh://git@git.example.com/max/webhook_test.git') - self.assertEqual( change["author"], "Max Mustermann ") self.assertEqual( @@ -762,6 +746,23 @@ class TestChangeHookGiteaPush(unittest.TestCase, TestReactorMixin): self.assertEqual(change[ "revlink"], "https://git.example.com/max/webhook_test/commit/ad7157cc4a137b3e1dfe92750ccfb1bbad239f9a") + change = self.changeHook.master.data.updates.changesAdded[1] + + self.assertEqual(change['repository'], 'ssh://git@git.example.com/max/webhook_test.git') + + self.assertEqual( + change["author"], "Max Mustermann ") + self.assertEqual( + change["revision"], '9d7157cc4a137b3e1dfe92750ccfb1bbad239f99') + self.assertEqual( + change["when_timestamp"], + 1536063014) + self.assertEqual( + change["comments"], "TestBranch\n") + self.assertEqual(change["branch"], "feature-branch") + self.assertEqual(change[ + "revlink"], + "https://git.example.com/max/webhook_test/commit/9d7157cc4a137b3e1dfe92750ccfb1bbad239f99") def checkChangesFromPullRequest(self, codebase=None): self.assertEqual(len(self.changeHook.master.data.updates.changesAdded), 1)