Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(212)

Unified Diff: scripts/slave/unittests/annotated_run_test.py

Issue 1884523002: Extract update_scripts out of annotated_run (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: presubmit Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « scripts/slave/annotated_run.py ('k') | scripts/slave/update_scripts.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: scripts/slave/unittests/annotated_run_test.py
diff --git a/scripts/slave/unittests/annotated_run_test.py b/scripts/slave/unittests/annotated_run_test.py
index f8eea18ebd67e860364beef35229e4db4b1363ad..9d61396655ff95239c8ed8e0bcfdea8eb5498464 100755
--- a/scripts/slave/unittests/annotated_run_test.py
+++ b/scripts/slave/unittests/annotated_run_test.py
@@ -24,6 +24,7 @@ from common import env
from slave import annotated_run
from slave import gce
from slave import infra_platform
+from slave import update_scripts
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
@@ -50,24 +51,29 @@ class AnnotatedRunTest(unittest.TestCase):
'--build-properties=%s' % json.dumps(build_properties)])
self.assertEqual(exit_code, 0)
+ @mock.patch('slave.update_scripts._run_command')
@mock.patch('slave.annotated_run._run_command')
@mock.patch('slave.annotated_run.main')
@mock.patch('sys.platform', return_value='win')
@mock.patch('tempfile.mkstemp', side_effect=Exception('failure'))
@mock.patch('os.environ', {})
def test_update_scripts_must_run(self, _tempfile_mkstemp, _sys_platform,
- main, run_command):
- annotated_run.main.side_effect = Exception('Test error!')
+ main, annotated_run_command,
+ update_scripts_run_command):
+ update_scripts._run_command.return_value = (0, "")
annotated_run._run_command.return_value = (0, "")
+ annotated_run.main.side_effect = Exception('Test error!')
annotated_run.shell_main(['annotated_run.py', 'foo'])
gclient_path = os.path.join(env.Build, os.pardir, 'depot_tools',
'gclient.bat')
- run_command.assert_has_calls([
+ annotated_run_command.assert_has_calls([
+ mock.call([sys.executable, 'annotated_run.py', 'foo']),
+ ])
+ update_scripts_run_command.assert_has_calls([
mock.call([gclient_path, 'sync', '--force', '--verbose', '--jobs=2',
'--break_repo_locks'],
cwd=env.Build),
- mock.call([sys.executable, 'annotated_run.py', 'foo']),
])
main.assert_not_called()
« no previous file with comments | « scripts/slave/annotated_run.py ('k') | scripts/slave/update_scripts.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698