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

Side by Side Diff: client/tests/run_isolated_test.py

Issue 1342673003: Significant refactoring of run_isolated. (Closed) Base URL: git@github.com:luci/luci-py.git@master
Patch Set: . Created 5 years, 3 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 unified diff | Download patch
« no previous file with comments | « client/run_isolated.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright 2013 The Swarming Authors. All rights reserved. 2 # Copyright 2013 The Swarming Authors. All rights reserved.
3 # Use of this source code is governed under the Apache License, Version 2.0 that 3 # Use of this source code is governed under the Apache License, Version 2.0 that
4 # can be found in the LICENSE file. 4 # can be found in the LICENSE file.
5 5
6 # pylint: disable=R0201 6 # pylint: disable=R0201
7 7
8 import StringIO 8 import StringIO
9 import functools 9 import functools
10 import json 10 import json
(...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after
441 '--isolate-server', 'https://localhost:1', 441 '--isolate-server', 'https://localhost:1',
442 '--json', out, 442 '--json', out,
443 ] 443 ]
444 ret = run_isolated.main(cmd) 444 ret = run_isolated.main(cmd)
445 self.assertEqual(0, ret) 445 self.assertEqual(0, ret)
446 # Replace ${ISOLATED_OUTDIR} with the temporary directory. 446 # Replace ${ISOLATED_OUTDIR} with the temporary directory.
447 sub_cmd[2] = self.popen_calls[0][0][2] 447 sub_cmd[2] = self.popen_calls[0][0][2]
448 self.assertNotIn('ISOLATED_OUTDIR', sub_cmd[2]) 448 self.assertNotIn('ISOLATED_OUTDIR', sub_cmd[2])
449 self.assertEqual([(sub_cmd, {'detached': True})], self.popen_calls) 449 self.assertEqual([(sub_cmd, {'detached': True})], self.popen_calls)
450 expected = { 450 expected = {
451 u'isolated': u'e0a0fffa0910dd09e7ef4c89496116f60317e6c4', 451 u'exit_code': 0,
452 u'isolatedserver': u'http://localhost:1', 452 u'internal_failure': None,
453 u'namespace': u'default-gzip', 453 u'outputs_ref': {
454 u'isolated': u'e0a0fffa0910dd09e7ef4c89496116f60317e6c4',
455 u'isolatedserver': u'http://localhost:1',
456 u'namespace': u'default-gzip',
457 },
458 u'version': 1,
454 } 459 }
455 self.assertEqual(expected, tools.read_json(out)) 460 self.assertEqual(expected, tools.read_json(out))
456 461
457 462
458 if __name__ == '__main__': 463 if __name__ == '__main__':
459 logging.basicConfig( 464 logging.basicConfig(
460 level=logging.DEBUG if '-v' in sys.argv else logging.ERROR) 465 level=logging.DEBUG if '-v' in sys.argv else logging.ERROR)
461 unittest.main() 466 unittest.main()
OLDNEW
« no previous file with comments | « client/run_isolated.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698