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

Side by Side Diff: dashboard/dashboard/pinpoint/models/change_test.py

Issue 2998883002: [pinpoint] Strip '.git' from the end of repository URLs in DEPS files. (Closed)
Patch Set: Created 3 years, 4 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 unified diff | Download patch
« no previous file with comments | « dashboard/dashboard/pinpoint/models/change.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2016 The Chromium Authors. All rights reserved. 1 # Copyright 2016 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import unittest 5 import unittest
6 6
7 import mock 7 import mock
8 8
9 from dashboard.common import namespaced_stored_object 9 from dashboard.common import namespaced_stored_object
10 from dashboard.common import testing_common 10 from dashboard.common import testing_common
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 return [{'commit': 'babe852'}] 102 return [{'commit': 'babe852'}]
103 if first_git_hash == '0000000' and last_git_hash == '2222222': 103 if first_git_hash == '0000000' and last_git_hash == '2222222':
104 return [{'commit': '2222222'}, {'commit': '1111111'}] 104 return [{'commit': '2222222'}, {'commit': '1111111'}]
105 raise NotImplementedError() 105 raise NotImplementedError()
106 commit_range.side_effect = _CommitRange 106 commit_range.side_effect = _CommitRange
107 107
108 def _FileContents(repository_url, git_hash, path): 108 def _FileContents(repository_url, git_hash, path):
109 del repository_url 109 del repository_url
110 del path 110 del path
111 if git_hash == '0e57e2b': 111 if git_hash == '0e57e2b':
112 return 'deps = {"src/catapult": "%s@0000000"}' % _CATAPULT_URL 112 # Also test the stripping of '.git' from repository URLs.
113 return 'deps = {"src/catapult": "%s@0000000"}' % (
114 _CATAPULT_URL + '.git')
113 if git_hash == 'babe852': 115 if git_hash == 'babe852':
114 return 'deps = {"src/catapult": "%s@2222222"}' % _CATAPULT_URL 116 return 'deps = {"src/catapult": "%s@2222222"}' % _CATAPULT_URL
115 raise NotImplementedError() 117 raise NotImplementedError()
116 file_contents.side_effect = _FileContents 118 file_contents.side_effect = _FileContents
117 119
118 change_a = change.Change(change.Dep('src', '0e57e2b')) 120 change_a = change.Change(change.Dep('src', '0e57e2b'))
119 change_b = change.Change(change.Dep('src', 'babe852')) 121 change_b = change.Change(change.Dep('src', 'babe852'))
120 expected = change.Change(change.Dep('src', '0e57e2b'), 122 expected = change.Change(change.Dep('src', '0e57e2b'),
121 (change.Dep('catapult', '1111111'),)) 123 (change.Dep('catapult', '1111111'),))
122 124
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
351 def testFromDict(self): 353 def testFromDict(self):
352 patch = change.Patch.FromDict({ 354 patch = change.Patch.FromDict({
353 'server': 'https://codereview.chromium.org', 355 'server': 'https://codereview.chromium.org',
354 'issue': 2851943002, 356 'issue': 2851943002,
355 'patchset': 40001, 357 'patchset': 40001,
356 }) 358 })
357 359
358 expected = change.Patch('https://codereview.chromium.org', 360 expected = change.Patch('https://codereview.chromium.org',
359 2851943002, 40001) 361 2851943002, 40001)
360 self.assertEqual(patch, expected) 362 self.assertEqual(patch, expected)
OLDNEW
« no previous file with comments | « dashboard/dashboard/pinpoint/models/change.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698