[webkit-patch] Use commit.webkit.org instead of remote SVN to compute identifier
[WebKit-https.git] / Tools / Scripts / webkitpy / tool / steps / closebugforlanddiff_unittest.py
index decd8961c0ef28ec3879e0b3b7e0c27d052789a9..ec347be406bcc586f903fad55af241f798657933 100644 (file)
@@ -1,5 +1,5 @@
 # Copyright (C) 2009 Google Inc. All rights reserved.
-# Copyright (C) 2020 Apple Inc. All rights reserved.
+# Copyright (C) 2020-2021 Apple Inc. All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
 # modification, are permitted provided that the following conditions are
@@ -33,27 +33,17 @@ import unittest
 from webkitpy.tool.mocktool import MockOptions, MockTool
 from webkitpy.tool.steps.closebugforlanddiff import CloseBugForLandDiff
 
-from webkitcorepy import OutputCapture
-from webkitscmpy import mocks, Commit
+from webkitcorepy import mocks, OutputCapture
 
 
 class CloseBugForLandDiffTest(unittest.TestCase):
     def test_empty_state(self):
-        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',
+        with mocks.Requests('commits.webkit.org', **{
+            'r49824/json': mocks.Response.fromJson(dict(
+                identifier='5@main',
                 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'))