[webkit-patch] Use identifiers when posting to bugzilla
[WebKit-https.git] / Tools / Scripts / webkitpy / tool / steps / closebugforlanddiff_unittest.py
index 5d119d64abd0e00413cc5d1e61f49ce8fdcdd624..55d99bf4f58c0beb0c768e54435865336cb08c7b 100644 (file)
@@ -34,14 +34,30 @@ from webkitpy.tool.mocktool import MockOptions, MockTool
 from webkitpy.tool.steps.closebugforlanddiff import CloseBugForLandDiff
 
 from webkitcorepy import OutputCapture
+from webkitscmpy import mocks, Commit
 
 
 class CloseBugForLandDiffTest(unittest.TestCase):
     def test_empty_state(self):
-        step = CloseBugForLandDiff(MockTool(), MockOptions())
-        with OutputCapture(level=logging.INFO) as captured:
-            step.run(dict(commit_text='Mock commit text'))
-        self.assertEqual(
-            captured.root.log.getvalue(),
-            'Committed r49824: <https://commits.webkit.org/r49824>\nNo bug id provided.\n'
-        )
+        with mocks.remote.Svn('svn.webkit.org/repository/webkit') as repo:
+            repo.commits['trunk'].append(Commit(
+                author=dict(name='Dmitry Titov', emails=['dimich@chromium.org']),
+                identifier='5@trunk',
+                revision=49824,
+                timestamp=1601668000,
+                message=
+                    'Manual Test for crash caused by JS accessing DOMWindow which is disconnected from the Frame.\n'
+                    'https://bugs.webkit.org/show_bug.cgi?id=30544\n'
+                    '\n'
+                    'Reviewed by Darin Adler.\n'
+                    '\n'
+                    '    manual-tests/crash-on-accessing-domwindow-without-frame.html: Added.\n',
+            ))
+
+            step = CloseBugForLandDiff(MockTool(), MockOptions())
+            with OutputCapture(level=logging.INFO) as captured:
+                step.run(dict(commit_text='Mock commit text'))
+            self.assertEqual(
+                captured.root.log.getvalue(),
+                'Committed 5@main: <https://commits.webkit.org/5@main>\nNo bug id provided.\n'
+            )