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

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

Issue 2037253002: run_isolated.py: install CIPD packages (Closed) Base URL: https://chromium.googlesource.com/external/github.com/luci/luci-py@master
Patch Set: fix client fetching Created 4 years, 6 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/tests/run_isolated_test.py ('k') | client/tests/swarming_test.py » ('j') | 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 LUCI Authors. All rights reserved. 2 # Copyright 2013 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 itertools 6 import itertools
7 import logging 7 import logging
8 import os 8 import os
9 import sys 9 import sys
10 import tempfile 10 import tempfile
(...skipping 647 matching lines...) Expand 10 before | Expand all | Expand 10 after
658 self.assertEqual(1, proc.wait()) 658 self.assertEqual(1, proc.wait())
659 self.assertEqual((None, None), proc.recv_any()) 659 self.assertEqual((None, None), proc.recv_any())
660 else: 660 else:
661 self.assertEqual(0, proc.wait()) 661 self.assertEqual(0, proc.wait())
662 self.assertEqual(('stdout', 'got signal 15\nbye\n'), proc.recv_any()) 662 self.assertEqual(('stdout', 'got signal 15\nbye\n'), proc.recv_any())
663 finally: 663 finally:
664 # In case the test fails. 664 # In case the test fails.
665 proc.kill() 665 proc.kill()
666 proc.wait() 666 proc.wait()
667 667
668 def test_split(self):
669 data = [
670 ('stdout', 'o1\no2\no3\n'),
671 ('stderr', 'e1\ne2\ne3\n'),
672 ('stdout', '\n\n'),
673 ('stdout', '\n'),
674 ('stdout', 'o4\no5'),
675 ('stdout', '_sameline\npart1 of one line '),
676 ('stderr', 'err inserted between two parts of stdout\n'),
677 ('stdout', 'part2 of one line\n'),
678 ('stdout', 'incomplete last stdout'),
679 ('stderr', 'incomplete last stderr'),
680 ]
681 self.assertEquals(list(subprocess42.split(data)), [
682 ('stdout', 'o1'),
683 ('stdout', 'o2'),
684 ('stdout', 'o3'),
685 ('stderr', 'e1'),
686 ('stderr', 'e2'),
687 ('stderr', 'e3'),
688 ('stdout', ''),
689 ('stdout', ''),
690 ('stdout', ''),
691 ('stdout', 'o4'),
692 ('stdout', 'o5_sameline'),
693 ('stderr', 'err inserted between two parts of stdout'),
694 ('stdout', 'part1 of one line part2 of one line'),
695 ('stderr', 'incomplete last stderr'),
696 ('stdout', 'incomplete last stdout'),
697 ])
668 698
669 if __name__ == '__main__': 699 if __name__ == '__main__':
670 if '-v' in sys.argv: 700 if '-v' in sys.argv:
671 unittest.TestCase.maxDiff = None 701 unittest.TestCase.maxDiff = None
672 logging.basicConfig( 702 logging.basicConfig(
673 level=logging.DEBUG if '-v' in sys.argv else logging.ERROR) 703 level=logging.DEBUG if '-v' in sys.argv else logging.ERROR)
674 unittest.main() 704 unittest.main()
OLDNEW
« no previous file with comments | « client/tests/run_isolated_test.py ('k') | client/tests/swarming_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698