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

Side by Side Diff: build/android/devil/utils/cmd_helper_test.py

Issue 1314913009: [Android] Move some pylib modules into devil/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase 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 | « build/android/devil/utils/cmd_helper.py ('k') | build/android/devil/utils/host_utils.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 # Copyright 2013 The Chromium Authors. All rights reserved. 1 # Copyright 2013 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 """Tests for the cmd_helper module.""" 5 """Tests for the cmd_helper module."""
6 6
7 import unittest 7 import unittest
8 import subprocess 8 import subprocess
9 9
10 from pylib import cmd_helper 10 from devil.utils import cmd_helper
11 11
12 12
13 class CmdHelperSingleQuoteTest(unittest.TestCase): 13 class CmdHelperSingleQuoteTest(unittest.TestCase):
14 14
15 def testSingleQuote_basic(self): 15 def testSingleQuote_basic(self):
16 self.assertEquals('hello', 16 self.assertEquals('hello',
17 cmd_helper.SingleQuote('hello')) 17 cmd_helper.SingleQuote('hello'))
18 18
19 def testSingleQuote_withSpaces(self): 19 def testSingleQuote_withSpaces(self):
20 self.assertEquals("'hello world'", 20 self.assertEquals("'hello world'",
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 self.assertEquals(num, int(line)) 74 self.assertEquals(num, int(line))
75 75
76 def testIterCmdOutputLines_exitStatusSkipped(self): 76 def testIterCmdOutputLines_exitStatusSkipped(self):
77 for num, line in enumerate( 77 for num, line in enumerate(
78 cmd_helper.IterCmdOutputLines('seq 10 && false', shell=True), 1): 78 cmd_helper.IterCmdOutputLines('seq 10 && false', shell=True), 1):
79 self.assertEquals(num, int(line)) 79 self.assertEquals(num, int(line))
80 # no exception will be raised because we don't attempt to read past 80 # no exception will be raised because we don't attempt to read past
81 # the end of the output and, thus, the status never gets checked 81 # the end of the output and, thus, the status never gets checked
82 if num == 10: 82 if num == 10:
83 break 83 break
OLDNEW
« no previous file with comments | « build/android/devil/utils/cmd_helper.py ('k') | build/android/devil/utils/host_utils.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698