OLD | NEW |
1 # Copyright (C) 2013 Google Inc. All rights reserved. | 1 # Copyright (C) 2013 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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 failure = test_failures.FailureReftestMismatch() | 72 failure = test_failures.FailureReftestMismatch() |
73 failure.reference_filename = 'notfound.html' | 73 failure.reference_filename = 'notfound.html' |
74 written_files = self.run_test(failures=[failure], files={}) | 74 written_files = self.run_test(failures=[failure], files={}) |
75 self.assertEqual(written_files, {}) | 75 self.assertEqual(written_files, {}) |
76 | 76 |
77 failure = test_failures.FailureReftestMismatchDidNotOccur() | 77 failure = test_failures.FailureReftestMismatchDidNotOccur() |
78 failure.reference_filename = 'notfound.html' | 78 failure.reference_filename = 'notfound.html' |
79 written_files = self.run_test(failures=[failure], files={}) | 79 written_files = self.run_test(failures=[failure], files={}) |
80 self.assertEqual(written_files, {}) | 80 self.assertEqual(written_files, {}) |
81 | 81 |
| 82 def test_reftest_image_missing(self): |
| 83 failure = test_failures.FailureReftestNoImageGenerated() |
| 84 failure.reference_filename = '/src/exists-expected.html' |
| 85 files = {'/src/exists-expected.html': 'yup'} |
| 86 written_files = self.run_test(failures=[failure], files=files) |
| 87 self.assertEqual(written_files, {'/tmp/exists-expected.html': 'yup'}) |
| 88 |
| 89 failure = test_failures.FailureReftestNoReferenceImageGenerated() |
| 90 failure.reference_filename = '/src/exists-expected.html' |
| 91 files = {'/src/exists-expected.html': 'yup'} |
| 92 written_files = self.run_test(failures=[failure], files=files) |
| 93 self.assertEqual(written_files, {'/tmp/exists-expected.html': 'yup'}) |
| 94 |
82 def test_baseline_name(self): | 95 def test_baseline_name(self): |
83 fs = MockFileSystem() | 96 fs = MockFileSystem() |
84 self.assertEqual(baseline_name(fs, 'x/y/foo.html', 'txt'), 'x/y/foo-expe
cted.txt') | 97 self.assertEqual(baseline_name(fs, 'x/y/foo.html', 'txt'), 'x/y/foo-expe
cted.txt') |
85 self.assertEqual(baseline_name(fs, 'foo.html', 'txt'), 'foo-expected.txt
') | 98 self.assertEqual(baseline_name(fs, 'foo.html', 'txt'), 'foo-expected.txt
') |
86 self.assertEqual(baseline_name(fs, 'foo', 'txt'), 'foo-expected.txt') | 99 self.assertEqual(baseline_name(fs, 'foo', 'txt'), 'foo-expected.txt') |
OLD | NEW |