Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2445)

Unified Diff: experimental/bisect_lib/fetch_revision_info_test.py

Issue 1521503002: Update bisect_lib with the changes committed in the infra/build repo. (Closed) Base URL: https://github.com/catapult-project/catapult.git@master
Patch Set: In README: add back license header, add link to Telemetry docs in catapult Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: experimental/bisect_lib/fetch_revision_info_test.py
diff --git a/experimental/bisect_lib/fetch_revision_info_test.py b/experimental/bisect_lib/fetch_revision_info_test.py
new file mode 100755
index 0000000000000000000000000000000000000000..3a989ccd15929be3430731636565f40139db5801
--- /dev/null
+++ b/experimental/bisect_lib/fetch_revision_info_test.py
@@ -0,0 +1,49 @@
+#!/usr/bin/python
+# Copyright 2015 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import os
+import sys
+import unittest
+
+_CATAPULT_PATH = os.path.abspath(os.path.join(
+ os.path.dirname(__file__), os.path.pardir, os.path.pardir))
+sys.path.insert(0, os.path.join(_CATAPULT_PATH, 'third_party', 'mock'))
+
+import mock
+
+import fetch_revision_info # pylint: disable=relative-import
+
+_TEST_DATA_PATH = os.path.join(os.path.dirname(__file__), 'test_data')
+_MOCK_RESPONSE_PATH = os.path.join(_TEST_DATA_PATH, 'MOCK_INFO_RESPONSE_FILE')
+
+
+class ChromiumRevisionsTest(unittest.TestCase):
+
+ def testRevisionInfo(self):
+ commit_hash = 'c89130e28fd01062104e1be7f3a6fc3abbb80ca9'
+ with mock.patch('urllib2.urlopen', mock.MagicMock(
+ return_value=open(_MOCK_RESPONSE_PATH))):
+ revision_info = fetch_revision_info.FetchRevisionInfo(
+ commit_hash, depot_name='chromium')
+ self.assertEqual(
+ {
+ 'body': ('\nHiding actions without the toolbar redesign '
+ 'means removing them entirely, so if\nthey exist '
+ 'in the toolbar, they are considered \'visible\' '
+ '(even if they are in\nthe chevron).\n\n'
+ 'BUG=544859\nBUG=548160\n\nReview URL: '
+ 'https://codereview.chromium.org/1414343003\n\n'
+ 'Cr-Commit-Position: refs/heads/master@{#356400}'),
+ 'date': 'Tue Oct 27 21:26:30 2015',
+ 'subject': ('[Extensions] Fix hiding browser actions '
+ 'without the toolbar redesign'),
+ 'email': 'rdevlin.cronin@chromium.org',
+ 'author': 'rdevlin.cronin'
+ },
+ revision_info)
+
+
+if __name__ == '__main__':
+ unittest.main()
« no previous file with comments | « experimental/bisect_lib/fetch_revision_info.py ('k') | experimental/bisect_lib/test_data/MOCK_INFO_RESPONSE_FILE » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698