| OLD | NEW |
| 1 # Copyright (C) 2009 Google Inc. All rights reserved. | 1 # Copyright (C) 2009 Google Inc. All rights reserved. |
| 2 # | 2 # |
| 3 # Redistribution and use in source and binary forms, with or without | 3 # Redistribution and use in source and binary forms, with or without |
| 4 # modification, are permitted provided that the following conditions are | 4 # modification, are permitted provided that the following conditions are |
| 5 # met: | 5 # met: |
| 6 # | 6 # |
| 7 # * Redistributions of source code must retain the above copyright | 7 # * Redistributions of source code must retain the above copyright |
| 8 # notice, this list of conditions and the following disclaimer. | 8 # notice, this list of conditions and the following disclaimer. |
| 9 # * Redistributions in binary form must reproduce the above | 9 # * Redistributions in binary form must reproduce the above |
| 10 # copyright notice, this list of conditions and the following disclaimer | 10 # copyright notice, this list of conditions and the following disclaimer |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 }, | 205 }, |
| 206 "number": int(build_number), | 206 "number": int(build_number), |
| 207 "results": build_number % 2, # 0 means pass | 207 "results": build_number % 2, # 0 means pass |
| 208 } | 208 } |
| 209 return build_dictionary | 209 return build_dictionary |
| 210 buildbot._fetch_build_dictionary = mock_fetch_build_dictionary | 210 buildbot._fetch_build_dictionary = mock_fetch_build_dictionary |
| 211 | 211 |
| 212 build = builder.build(10) | 212 build = builder.build(10) |
| 213 self.assertEqual(build.builder(), builder) | 213 self.assertEqual(build.builder(), builder) |
| 214 self.assertEqual(build.url(), "http://build.chromium.org/p/chromium.webk
it/builders/Test%20Builder/builds/10") | 214 self.assertEqual(build.url(), "http://build.chromium.org/p/chromium.webk
it/builders/Test%20Builder/builds/10") |
| 215 self.assertEqual(build.results_url(), "https://storage.googleapis.com/ch
romium-layout-test-archives/Test_Builder/r20%20%2810%29") | 215 self.assertEqual( |
| 216 build.results_url(), |
| 217 "https://storage.googleapis.com/chromium-layout-test-archives/Test_B
uilder/r20%20%2810%29") |
| 216 self.assertEqual(build.revision(), 20) | 218 self.assertEqual(build.revision(), 20) |
| 217 self.assertTrue(build.is_green()) | 219 self.assertTrue(build.is_green()) |
| 218 | 220 |
| 219 build = build.previous_build() | 221 build = build.previous_build() |
| 220 self.assertEqual(build.builder(), builder) | 222 self.assertEqual(build.builder(), builder) |
| 221 self.assertEqual(build.url(), "http://build.chromium.org/p/chromium.webk
it/builders/Test%20Builder/builds/9") | 223 self.assertEqual(build.url(), "http://build.chromium.org/p/chromium.webk
it/builders/Test%20Builder/builds/9") |
| 222 self.assertEqual(build.results_url(), "https://storage.googleapis.com/ch
romium-layout-test-archives/Test_Builder/r18%20%289%29") | 224 self.assertEqual( |
| 225 build.results_url(), |
| 226 "https://storage.googleapis.com/chromium-layout-test-archives/Test_B
uilder/r18%20%289%29") |
| 223 self.assertEqual(build.revision(), 18) | 227 self.assertEqual(build.revision(), 18) |
| 224 self.assertFalse(build.is_green()) | 228 self.assertFalse(build.is_green()) |
| 225 | 229 |
| 226 self.assertIsNone(builder.build(None)) | 230 self.assertIsNone(builder.build(None)) |
| 227 | 231 |
| 228 _example_directory_listing = ''' | 232 _example_directory_listing = ''' |
| 229 <h1>Directory listing for /results/SnowLeopard Intel Leaks/</h1> | 233 <h1>Directory listing for /results/SnowLeopard Intel Leaks/</h1> |
| 230 | 234 |
| 231 <table> | 235 <table> |
| 232 <tr class="alt"> | 236 <tr class="alt"> |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 419 b._fetch_revision_to_build_map = self._fetch_revision_to_build_map | 423 b._fetch_revision_to_build_map = self._fetch_revision_to_build_map |
| 420 self.assertEqual("correct build", b.latest_cached_build()) | 424 self.assertEqual("correct build", b.latest_cached_build()) |
| 421 | 425 |
| 422 def results_url(self): | 426 def results_url(self): |
| 423 return "some-url" | 427 return "some-url" |
| 424 | 428 |
| 425 def test_results_zip_url(self): | 429 def test_results_zip_url(self): |
| 426 b = Build(None, 123, 123, False) | 430 b = Build(None, 123, 123, False) |
| 427 b.results_url = self.results_url | 431 b.results_url = self.results_url |
| 428 self.assertEqual("some-url.zip", b.results_zip_url()) | 432 self.assertEqual("some-url.zip", b.results_zip_url()) |
| OLD | NEW |