OLD | NEW |
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 json | 5 import json |
6 import logging | 6 import logging |
7 import unittest | 7 import unittest |
8 import urllib2 | 8 import urllib2 |
9 | 9 |
10 from webkitpy.common.net.rietveld import filter_latest_jobs | 10 from webkitpy.common.net.rietveld import filter_latest_jobs |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 self.assertEqual(latest_try_jobs(11112222, ('foo', 'bar'), self.web), []
) | 91 self.assertEqual(latest_try_jobs(11112222, ('foo', 'bar'), self.web), []
) |
92 | 92 |
93 def test_get_latest_try_job_results(self): | 93 def test_get_latest_try_job_results(self): |
94 self.assertEqual(get_latest_try_job_results(11112222, self.web), {'foo-b
uilder': 1, 'bar-builder': 0}) | 94 self.assertEqual(get_latest_try_job_results(11112222, self.web), {'foo-b
uilder': 1, 'bar-builder': 0}) |
95 | 95 |
96 def test_filter_latest_jobs_empty(self): | 96 def test_filter_latest_jobs_empty(self): |
97 self.assertEqual(filter_latest_jobs([]), []) | 97 self.assertEqual(filter_latest_jobs([]), []) |
98 | 98 |
99 def test_filter_latest_jobs_higher_build_first(self): | 99 def test_filter_latest_jobs_higher_build_first(self): |
100 self.assertEqual( | 100 self.assertEqual( |
101 filter_latest_jobs([ | 101 filter_latest_jobs([Build('foo', 5), Build('foo', 3), Build('bar', 5
)]), |
102 Build('foo', 5), | 102 [Build('foo', 5), Build('bar', 5)]) |
103 Build('foo', 3), | |
104 Build('bar', 5), | |
105 ]), | |
106 [ | |
107 Build('foo', 5), | |
108 Build('bar', 5), | |
109 ]) | |
110 | 103 |
111 def test_filter_latest_jobs_higher_build_last(self): | 104 def test_filter_latest_jobs_higher_build_last(self): |
112 self.assertEqual( | 105 self.assertEqual( |
113 filter_latest_jobs([ | 106 filter_latest_jobs([Build('foo', 3), Build('bar', 5), Build('foo', 5
)]), |
114 Build('foo', 3), | 107 [Build('bar', 5), Build('foo', 5)]) |
115 Build('bar', 5), | 108 |
116 Build('foo', 5), | 109 def test_filter_latest_jobs_no_build_number(self): |
117 ]), | 110 self.assertEqual( |
118 [ | 111 filter_latest_jobs([Build('foo', 3), Build('bar')]), |
119 Build('bar', 5), | 112 [Build('foo', 3)]) |
120 Build('foo', 5), | |
121 ]) | |
OLD | NEW |