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

Unified Diff: appengine_module/test_results/handlers/test/redirector_test.py

Issue 498083002: Make flakiness dashboard links to googlesource work post git migration. (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@deployable
Patch Set: move test to the right location Created 6 years, 3 months 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
« no previous file with comments | « appengine_module/test_results/handlers/redirector.py ('k') | appengine_module/test_results/main.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: appengine_module/test_results/handlers/test/redirector_test.py
diff --git a/appengine_module/test_results/handlers/test/redirector_test.py b/appengine_module/test_results/handlers/test/redirector_test.py
new file mode 100644
index 0000000000000000000000000000000000000000..9936998a4a78ed48ef95d0d762cd6a405fe470d2
--- /dev/null
+++ b/appengine_module/test_results/handlers/test/redirector_test.py
@@ -0,0 +1,36 @@
+# Copyright 2014 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 unittest
+
+from appengine_module.test_results.handlers import redirector
+
+class RedirectorTest(unittest.TestCase):
+
+ def test_url_from_commit_positions(self):
+ def mock_load_url(url):
+ if url == 'https://cr-rev.appspot.com/_ah/api/crrev/v1/redirect/1':
+ git_sha = 'aaaaaaa'
+ else:
+ git_sha = 'bbbbbbb'
+ return '''{
+ "git_sha": "%s",
+ "repo": "chromium/src",
+ "redirect_url": "https://chromium.googlesource.com/chromium/src/+/%s",
+ "project": "chromium",
+ "redirect_type": "GIT_FROM_NUMBER",
+ "repo_url": "https://chromium.googlesource.com/chromium/src/",
+ "kind": "crrev#redirectItem",
+ "etag": "\\\"vOastG91kaV9uxC3-P-4NolRM6s/U8-bHfeejPZOn0ELRGhed-nrIX4\\\""
+}''' % (git_sha, git_sha)
+
+ old_load_url = redirector.load_url
+ try:
+ redirector.load_url = mock_load_url
+
+ expected = ('https://chromium.googlesource.com/chromium/src/+log/'
+ 'aaaaaaa..bbbbbbb?pretty=fuller')
+ self.assertEqual(redirector.url_from_commit_positions(1, 2), expected)
+ finally:
+ redirector.load_url = old_load_url
« no previous file with comments | « appengine_module/test_results/handlers/redirector.py ('k') | appengine_module/test_results/main.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698