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

Side by Side Diff: scripts/slave/recipe_modules/auto_bisect/resources/fetch_intervening_revisions_test.py

Issue 2282563004: Do not exclude the last revision in the range returned by gitiles. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/build.git@master
Patch Set: typo Created 4 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 unified diff | Download patch
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright 2015 The Chromium Authors. All rights reserved. 2 # Copyright 2015 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 import os 6 import os
7 import sys 7 import sys
8 import unittest 8 import unittest
9 9
10 _BUILD_PATH = os.path.abspath(os.path.join( 10 _BUILD_PATH = os.path.abspath(os.path.join(
(...skipping 29 matching lines...) Expand all
40 ('66aeb2b7084850d09f3fccc7d7467b57e4da1882', '356389'), 40 ('66aeb2b7084850d09f3fccc7d7467b57e4da1882', '356389'),
41 ('01542ac6d0fbec6aa78e33e6c7ec49a582072ea9', '356390'), 41 ('01542ac6d0fbec6aa78e33e6c7ec49a582072ea9', '356390'),
42 ('8414732168a8867a5d6bd45eaade68a5820a9e34', '356391'), 42 ('8414732168a8867a5d6bd45eaade68a5820a9e34', '356391'),
43 ('4f81be50501fbc02d7e44df0d56032e5885e19b6', '356392'), 43 ('4f81be50501fbc02d7e44df0d56032e5885e19b6', '356392'),
44 ('7bd1741893bd4e233b5562a6926d7e395d558343', '356393'), 44 ('7bd1741893bd4e233b5562a6926d7e395d558343', '356393'),
45 ('ee261f306c3c66e96339aa1026d62a6d953302fe', '356394'), 45 ('ee261f306c3c66e96339aa1026d62a6d953302fe', '356394'),
46 ('f1c777e3f97a16cc6a3aa922a23602fa59412989', '356395'), 46 ('f1c777e3f97a16cc6a3aa922a23602fa59412989', '356395'),
47 ('8fcc8af20a3d41b0512e3b1486e4dc7de528a72b', '356396'), 47 ('8fcc8af20a3d41b0512e3b1486e4dc7de528a72b', '356396'),
48 ('3861789af25e2d3502f0fb7080da5785d31308aa', '356397'), 48 ('3861789af25e2d3502f0fb7080da5785d31308aa', '356397'),
49 ('6feaa73a54d0515ad2940709161ca0a5ad91d1f8', '356398'), 49 ('6feaa73a54d0515ad2940709161ca0a5ad91d1f8', '356398'),
50 ('2e93263dc74f0496100435e1fd7232e9e8323af0', '356399') 50 ('2e93263dc74f0496100435e1fd7232e9e8323af0', '356399'),
51 ('c89130e28fd01062104e1be7f3a6fc3abbb80ca9', '356400')
51 ]) 52 ])
52 53
53 def test_fetch_intervening_revisions_pagination(self): 54 def test_fetch_intervening_revisions_pagination(self):
54 55
55 def mock_urlopen(url): 56 def mock_urlopen(url):
56 if 's=' not in url: 57 if 's=' not in url:
57 return open(os.path.join(_TEST_DATA, 'MOCK_RANGE_RESPONSE_2_PAGE_1')) 58 return open(os.path.join(_TEST_DATA, 'MOCK_RANGE_RESPONSE_2_PAGE_1'))
58 return open(os.path.join(_TEST_DATA, 'MOCK_RANGE_RESPONSE_2_PAGE_2')) 59 return open(os.path.join(_TEST_DATA, 'MOCK_RANGE_RESPONSE_2_PAGE_2'))
59 60
60 with mock.patch('urllib2.urlopen', mock_urlopen): 61 with mock.patch('urllib2.urlopen', mock_urlopen):
61 revs = fetch_intervening_revisions.fetch_intervening_revisions( 62 revs = fetch_intervening_revisions.fetch_intervening_revisions(
62 '7bd1741893bd4e233b5562a6926d7e395d558343', 63 '7bd1741893bd4e233b5562a6926d7e395d558343',
63 '3861789af25e2d3502f0fb7080da5785d31308aa', 64 '3861789af25e2d3502f0fb7080da5785d31308aa',
64 'https://chromium.googlesource.com/chromium/src') 65 'https://chromium.googlesource.com/chromium/src')
65 66
66 self.assertEqual( 67 self.assertEqual(
67 revs, [ 68 revs, [
68 ('ee261f306c3c66e96339aa1026d62a6d953302fe', '356394'), 69 ('ee261f306c3c66e96339aa1026d62a6d953302fe', '356394'),
69 ('f1c777e3f97a16cc6a3aa922a23602fa59412989', '356395'), 70 ('f1c777e3f97a16cc6a3aa922a23602fa59412989', '356395'),
70 ('8fcc8af20a3d41b0512e3b1486e4dc7de528a72b', '356396'), 71 ('8fcc8af20a3d41b0512e3b1486e4dc7de528a72b', '356396'),
72 ('3861789af25e2d3502f0fb7080da5785d31308aa', '356397')
71 ]) 73 ])
72 74
73 75
74 if __name__ == '__main__': 76 if __name__ == '__main__':
75 unittest.main() 77 unittest.main()
OLDNEW
« no previous file with comments | « scripts/slave/recipe_modules/auto_bisect/resources/fetch_intervening_revisions.py ('k') | scripts/slave/recipes/bisect.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698