| 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 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 "number": int(build_number), | 203 "number": int(build_number), |
| 204 "results": build_number % 2, # 0 means pass | 204 "results": build_number % 2, # 0 means pass |
| 205 } | 205 } |
| 206 | 206 |
| 207 buildbot.fetch_build_dictionary = mock_fetch_build_dictionary | 207 buildbot.fetch_build_dictionary = mock_fetch_build_dictionary |
| 208 build = builder.build(10) | 208 build = builder.build(10) |
| 209 self.assertEqual(build.builder(), builder) | 209 self.assertEqual(build.builder(), builder) |
| 210 self.assertEqual(build.url(), "http://build.chromium.org/p/chromium.webk
it/builders/Test%20Builder/builds/10") | 210 self.assertEqual(build.url(), "http://build.chromium.org/p/chromium.webk
it/builders/Test%20Builder/builds/10") |
| 211 self.assertEqual( | 211 self.assertEqual( |
| 212 build.results_url(), | 212 build.results_url(), |
| 213 "https://storage.googleapis.com/chromium-layout-test-archives/Test_B
uilder/r20%20%2810%29") | 213 "https://storage.googleapis.com/chromium-layout-test-archives/Test_B
uilder/10/layout-test-results") |
| 214 self.assertEqual(build.revision(), 20) | 214 self.assertEqual(build.revision(), 20) |
| 215 self.assertTrue(build.is_green()) | 215 self.assertTrue(build.is_green()) |
| 216 | 216 |
| 217 build = build.previous_build() | 217 build = build.previous_build() |
| 218 self.assertEqual(build.builder(), builder) | 218 self.assertEqual(build.builder(), builder) |
| 219 self.assertEqual(build.url(), "http://build.chromium.org/p/chromium.webk
it/builders/Test%20Builder/builds/9") | 219 self.assertEqual(build.url(), "http://build.chromium.org/p/chromium.webk
it/builders/Test%20Builder/builds/9") |
| 220 self.assertEqual( | 220 self.assertEqual( |
| 221 build.results_url(), | 221 build.results_url(), |
| 222 "https://storage.googleapis.com/chromium-layout-test-archives/Test_B
uilder/r18%20%289%29") | 222 "https://storage.googleapis.com/chromium-layout-test-archives/Test_B
uilder/9/layout-test-results") |
| 223 self.assertEqual(build.revision(), 18) | 223 self.assertEqual(build.revision(), 18) |
| 224 self.assertFalse(build.is_green()) | 224 self.assertFalse(build.is_green()) |
| 225 | 225 |
| 226 self.assertIsNone(builder.build(None)) | 226 self.assertIsNone(builder.build(None)) |
| 227 | 227 |
| 228 _example_directory_listing = ''' | 228 _example_directory_listing = ''' |
| 229 <h1>Directory listing for /results/SnowLeopard Intel Leaks/</h1> | 229 <h1>Directory listing for /results/SnowLeopard Intel Leaks/</h1> |
| 230 | 230 |
| 231 <table> | 231 <table> |
| 232 <tr class="alt"> | 232 <tr class="alt"> |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 421 b._fetch_revision_to_build_map = self._fetch_revision_to_build_map | 421 b._fetch_revision_to_build_map = self._fetch_revision_to_build_map |
| 422 self.assertEqual("correct build", b.latest_cached_build()) | 422 self.assertEqual("correct build", b.latest_cached_build()) |
| 423 | 423 |
| 424 def results_url(self): | 424 def results_url(self): |
| 425 return "some-url" | 425 return "some-url" |
| 426 | 426 |
| 427 def test_results_zip_url(self): | 427 def test_results_zip_url(self): |
| 428 b = Build(None, 123, 123, False) | 428 b = Build(None, 123, 123, False) |
| 429 b.results_url = self.results_url | 429 b.results_url = self.results_url |
| 430 self.assertEqual("some-url.zip", b.results_zip_url()) | 430 self.assertEqual("some-url.zip", b.results_zip_url()) |
| OLD | NEW |