OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright 2016 The LUCI Authors. All rights reserved. | 2 # Copyright 2016 The LUCI Authors. All rights reserved. |
3 # Use of this source code is governed under the Apache License, Version 2.0 | 3 # Use of this source code is governed under the Apache License, Version 2.0 |
4 # that can be found in the LICENSE file. | 4 # that can be found in the LICENSE file. |
5 | 5 |
6 import json | |
7 import os | |
8 import subprocess | |
9 import sys | 6 import sys |
10 import unittest | 7 import unittest |
11 import copy | 8 import copy |
12 | 9 |
13 from collections import OrderedDict | 10 from collections import OrderedDict |
14 | 11 |
15 import test_env | 12 import test_env |
16 | 13 |
17 import mock | |
18 | |
19 from expect_tests.type_definitions import CheckFrame | 14 from expect_tests.type_definitions import CheckFrame |
20 from recipe_engine import checker | 15 from recipe_engine import checker |
21 | 16 |
22 | 17 |
23 class TestChecker(unittest.TestCase): | 18 class TestChecker(unittest.TestCase): |
24 def sanitize(self, checkframe): | 19 def sanitize(self, checkframe): |
25 return checkframe._replace(line=0, fname='') | 20 return checkframe._replace(line=0, fname='') |
26 | 21 |
27 def mk(self, fname, code, varmap): | 22 def mk(self, fname, code, varmap): |
28 return CheckFrame( | 23 return CheckFrame( |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
260 a = self.c['a'] | 255 a = self.c['a'] |
261 del self.c['a'] | 256 del self.c['a'] |
262 self.c['a'] = a | 257 self.c['a'] = a |
263 self.assertIn( | 258 self.assertIn( |
264 "key 'a' is out of order", | 259 "key 'a' is out of order", |
265 self.v(self.c, self.d)) | 260 self.v(self.c, self.d)) |
266 | 261 |
267 | 262 |
268 if __name__ == '__main__': | 263 if __name__ == '__main__': |
269 sys.exit(unittest.main()) | 264 sys.exit(unittest.main()) |
OLD | NEW |