| 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 | 6 import json |
| 7 import os | 7 import os |
| 8 import subprocess | 8 import subprocess |
| 9 import sys | 9 import sys |
| 10 import unittest | 10 import unittest |
| 11 | 11 |
| 12 import repo_test_util | 12 import repo_test_util |
| 13 | 13 |
| 14 from recipe_engine import package | |
| 15 | |
| 16 | 14 |
| 17 class TestAutoroll(repo_test_util.RepoTest): | 15 class TestAutoroll(repo_test_util.RepoTest): |
| 18 def run_roll(self, repo, *args): | 16 def run_roll(self, repo, *args): |
| 19 """Runs the autoroll command and returns JSON. | 17 """Runs the autoroll command and returns JSON. |
| 20 Does not commit the resulting roll. | 18 Does not commit the resulting roll. |
| 21 """ | 19 """ |
| 22 with repo_test_util.in_directory(repo['root']), \ | 20 with repo_test_util.in_directory(repo['root']), \ |
| 23 repo_test_util.temporary_file() as tempfile_path: | 21 repo_test_util.temporary_file() as tempfile_path: |
| 24 subprocess.check_output([ | 22 subprocess.check_output([ |
| 25 sys.executable, self._recipe_tool, | 23 sys.executable, self._recipe_tool, |
| (...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 505 '--project=c', | 503 '--project=c', |
| 506 '--project=d', | 504 '--project=d', |
| 507 ) | 505 ) |
| 508 self.assertFalse(roll_result['success']) | 506 self.assertFalse(roll_result['success']) |
| 509 self.assertFalse(bool(roll_result['roll_details'])) | 507 self.assertFalse(bool(roll_result['roll_details'])) |
| 510 self.assertFalse(bool(roll_result['rejected_candidates_details'])) | 508 self.assertFalse(bool(roll_result['rejected_candidates_details'])) |
| 511 | 509 |
| 512 | 510 |
| 513 if __name__ == '__main__': | 511 if __name__ == '__main__': |
| 514 sys.exit(unittest.main()) | 512 sys.exit(unittest.main()) |
| OLD | NEW |