OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright 2014 The Chromium Authors. All rights reserved. | 2 # Copyright 2014 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 import os | 6 import os |
7 import subprocess | 7 import subprocess |
8 import sys | 8 import sys |
9 import unittest | 9 import unittest |
10 | 10 |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 properties = {} | 64 properties = {} |
65 | 65 |
66 test_data = mock.Mock() | 66 test_data = mock.Mock() |
67 test_data.enabled = True | 67 test_data.enabled = True |
68 test_data.consumed = False | 68 test_data.consumed = False |
69 | 69 |
70 api = mock.Mock() | 70 api = mock.Mock() |
71 api._engine = mock.Mock() | 71 api._engine = mock.Mock() |
72 api._engine.properties = properties | 72 api._engine.properties = properties |
73 | 73 |
74 engine = recipe_engine.run.RecipeEngine(stream, properties, test_data) | 74 engine = recipe_engine.run.RecipeEngine(stream, properties, test_data, None) |
75 | 75 |
76 class FakeScript(object): | 76 class FakeScript(object): |
77 def run(self, _, __): | 77 def run(self, _, __): |
78 return None | 78 return None |
79 | 79 |
80 with mock.patch('recipe_engine.run.RecipeEngine._emit_results'): | 80 with mock.patch('recipe_engine.run.RecipeEngine._emit_results'): |
81 with self.assertRaises(AssertionError): | 81 with self.assertRaises(AssertionError): |
82 engine.run(FakeScript(), api) | 82 engine.run(FakeScript(), api) |
83 | 83 |
84 | 84 |
85 | |
86 if __name__ == '__main__': | 85 if __name__ == '__main__': |
87 unittest.TestCase.maxDiff = None | 86 unittest.TestCase.maxDiff = None |
88 unittest.main() | 87 unittest.main() |
OLD | NEW |