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

Side by Side Diff: recipe_engine/unittests/step_runner_test.py

Issue 1959563002: Use subprocess42 in recipe_engine to avoid threading madness. (Closed) Base URL: https://chromium.googlesource.com/external/github.com/luci/recipes-py@master
Patch Set: Don't need a lock because we're single threaded now! Created 4 years, 7 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
OLDNEW
(Empty)
1 #!/usr/bin/env python
2 # Copyright 2013 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file.
5
6 import os
7 import shutil
8 import sys
9 import tempfile
10 import unittest
11
12 sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(
13 os.path.abspath(__file__)))))
14
15 from recipe_engine import step_runner
16
17
18 class TestLinebuf(unittest.TestCase):
19 def test_add_partial(self):
20 lb = step_runner._streamingLinebuf()
21 lb.ingest("blarf")
22 self.assertEqual([], list(lb))
23
24 def test_add_whole(self):
25 lb = step_runner._streamingLinebuf()
26 lb.ingest("blarf\n")
27 self.assertEqual(["blarf"], list(lb))
28
29 def test_add_partial_whole(self):
30 lb = step_runner._streamingLinebuf()
31 lb.ingest("foof\nfleem\nblarf")
32 self.assertEqual(["foof", "fleem"], list(lb))
33
34 def test_leftovers(self):
35 lb = step_runner._streamingLinebuf()
36
37 lb.ingest("nerds")
38 self.assertEqual([], list(lb))
39
40 lb.ingest("doop\n")
41 self.assertEqual(["nerdsdoop"], list(lb))
42
43 self.assertEqual([], list(lb))
44
45
46 if __name__ == '__main__':
47 unittest.main()
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698