OLD | NEW |
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 Loading... |
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() |
OLD | NEW |