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

Unified Diff: native_client_sdk/src/tools/tests/httpd_test.py

Issue 720233003: [NaCl SDK] Convert python scripts from optparse to argparse. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: native_client_sdk/src/tools/tests/httpd_test.py
diff --git a/native_client_sdk/src/tools/tests/httpd_test.py b/native_client_sdk/src/tools/tests/httpd_test.py
index 9cdeaeca1f57b68d870ab8f471a98e2135ced612..c811a8d9290e02d7b852f653cb2f487ccdf57ded 100755
--- a/native_client_sdk/src/tools/tests/httpd_test.py
+++ b/native_client_sdk/src/tools/tests/httpd_test.py
@@ -47,8 +47,7 @@ class RunTest(unittest.TestCase):
def _Run(self, args=None, timeout=None):
args = args or []
- run_py = os.path.join(PARENT_DIR, 'run.py')
- cmd = [sys.executable, run_py]
+ cmd = [sys.executable, os.path.join(PARENT_DIR, 'run.py')]
binji 2014/11/13 23:57:05 seems unrelated
Sam Clegg 2014/11/30 17:55:14 Done.
cmd.extend(args)
self.process = subprocess.Popen(cmd, stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
@@ -81,16 +80,17 @@ class RunTest(unittest.TestCase):
def testQuit(self):
args = self._GetChromeMockArgs('?quit=1', 'get', sleep=10)
- _, stdout, _ = self._Run(args, timeout=20)
- self.assertTrue('Starting' in stdout)
- self.assertTrue('Expected to be killed' not in stdout)
+ rtn, stdout, _ = self._Run(args, timeout=20)
+ self.assertEqual(rtn, 0)
+ self.assertIn('Starting', stdout)
+ self.assertNotIn('Expected to be killed', stdout)
def testSubprocessDies(self):
args = self._GetChromeMockArgs(page=None, http_request_type=None, sleep=0,
expect_to_be_killed=False)
returncode, stdout, _ = self._Run(args, timeout=10)
self.assertNotEqual(-1, returncode)
- self.assertTrue('Starting' in stdout)
+ self.assertIn('Starting', stdout)
if __name__ == '__main__':

Powered by Google App Engine
This is Rietveld 408576698