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 | 8 |
12 import test_env | 9 import test_env |
13 import mock | |
14 | 10 |
15 from recipe_engine import package | |
16 from recipe_engine import autoroll | 11 from recipe_engine import autoroll |
17 | 12 |
18 class FakeCandidate(object): | 13 class FakeCandidate(object): |
19 def __init__(self, data, projects=None): | 14 def __init__(self, data, projects=None): |
20 self._projects = projects | 15 self._projects = projects |
21 self._data = data | 16 self._data = data |
22 | 17 |
23 def get_affected_projects(self): | 18 def get_affected_projects(self): |
24 return self._projects | 19 return self._projects |
25 | 20 |
(...skipping 27 matching lines...) Expand all Loading... |
53 def test_ignore_some_candidates(self): | 48 def test_ignore_some_candidates(self): |
54 self.assertEqual( | 49 self.assertEqual( |
55 ['build', ], | 50 ['build', ], |
56 autoroll.process_rejected([ | 51 autoroll.process_rejected([ |
57 FakeCandidate('build', ['build']), | 52 FakeCandidate('build', ['build']), |
58 FakeCandidate('depot_tools', ['depot_tools']), | 53 FakeCandidate('depot_tools', ['depot_tools']), |
59 ], ['build'])) | 54 ], ['build'])) |
60 | 55 |
61 if __name__ == '__main__': | 56 if __name__ == '__main__': |
62 sys.exit(unittest.main()) | 57 sys.exit(unittest.main()) |
OLD | NEW |