| OLD | NEW |
| 1 # Copyright (C) 2010 Google Inc. All rights reserved. | 1 # Copyright (C) 2010 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 13 matching lines...) Expand all Loading... |
| 24 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 24 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 25 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 25 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 26 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 26 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 27 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 27 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 28 | 28 |
| 29 # Allow this unittest to access _members. | 29 # Allow this unittest to access _members. |
| 30 # pylint: disable=W0212 | 30 # pylint: disable=W0212 |
| 31 | 31 |
| 32 import json | 32 import json |
| 33 import logging | 33 import logging |
| 34 import os |
| 34 import unittest | 35 import unittest |
| 35 | 36 |
| 36 from appengine.test_results.model import jsonresults | 37 from appengine.path_mangler_hack import PathMangler |
| 37 from appengine.test_results.model.jsonresults import ( | 38 with PathMangler(os.path.dirname(os.path.dirname(__file__))): |
| 38 JsonResults, | 39 from appengine.test_results.model import jsonresults |
| 39 TEXT, | 40 from appengine.test_results.model.jsonresults import ( |
| 40 FAIL, | 41 JsonResults, |
| 41 LEAK, | 42 TEXT, |
| 42 PASS, | 43 FAIL, |
| 43 TIMEOUT, | 44 LEAK, |
| 44 IMAGE, | 45 PASS, |
| 45 NO_DATA, | 46 TIMEOUT, |
| 46 IMAGE_PLUS_TEXT, | 47 IMAGE, |
| 47 CRASH, | 48 NO_DATA, |
| 48 NOTRUN, | 49 IMAGE_PLUS_TEXT, |
| 49 TestFile, | 50 CRASH, |
| 50 ) | 51 NOTRUN, |
| 51 from appengine.test_results.handlers import master_config | 52 TestFile, |
| 53 ) |
| 54 from appengine.test_results.handlers import master_config |
| 52 | 55 |
| 53 from google.appengine.ext import testbed | 56 from google.appengine.ext import testbed |
| 54 | 57 |
| 55 FULL_RESULT_EXAMPLE = """ADD_RESULTS({ | 58 FULL_RESULT_EXAMPLE = """ADD_RESULTS({ |
| 56 "seconds_since_epoch": 1368146629, | 59 "seconds_since_epoch": 1368146629, |
| 57 "tests": { | 60 "tests": { |
| 58 "media": { | 61 "media": { |
| 59 "encrypted-media": { | 62 "encrypted-media": { |
| 60 "encrypted-media-v2-events.html": { | 63 "encrypted-media-v2-events.html": { |
| 61 "bugs": ["crbug.com/1234"], | 64 "bugs": ["crbug.com/1234"], |
| (...skipping 1173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1235 'Linux Tests': { | 1238 'Linux Tests': { |
| 1236 'results': {'foo': {'results': [(1, 'P')], | 1239 'results': {'foo': {'results': [(1, 'P')], |
| 1237 'times': [(1, 1)]}}, | 1240 'times': [(1, 1)]}}, |
| 1238 } | 1241 } |
| 1239 } | 1242 } |
| 1240 JsonResults._normalize_results(aggregated_json, 1, 2) | 1243 JsonResults._normalize_results(aggregated_json, 1, 2) |
| 1241 | 1244 |
| 1242 | 1245 |
| 1243 if __name__ == '__main__': | 1246 if __name__ == '__main__': |
| 1244 unittest.main() | 1247 unittest.main() |
| OLD | NEW |