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

Unified Diff: tools/chrome_proxy/webdriver/simple_smoke.py

Issue 2559113005: Use python's unittest framework. (Closed)
Patch Set: Explain comment better Created 4 years 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
« no previous file with comments | « tools/chrome_proxy/webdriver/common.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/chrome_proxy/webdriver/simple_smoke.py
diff --git a/tools/chrome_proxy/webdriver/simple_smoke.py b/tools/chrome_proxy/webdriver/simple_smoke.py
index 5513be9e05d6f55349456611b55fe1b8e64f3069..eacb8e5abd8743db9e0626551f0a775648b67ef2 100644
--- a/tools/chrome_proxy/webdriver/simple_smoke.py
+++ b/tools/chrome_proxy/webdriver/simple_smoke.py
@@ -2,16 +2,18 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+import sys
import time
+import unittest
-from common import IntegrationTest
+import common
from common import TestDriver
-class SimpleSmoke(IntegrationTest):
+class SimpleSmoke(unittest.TestCase):
# Simple example integration test.
- def TestCheckPageWithProxy(self):
+ def testCheckPageWithProxy(self):
with TestDriver() as t:
t.AddChromeArg('--enable-spdy-proxy-auth')
t.SetURL('http://check.googlezip.net/test.html')
@@ -25,7 +27,7 @@ class SimpleSmoke(IntegrationTest):
response.ResponseHasViaHeader(), response.WasXHR())
# Show how to get a histogram.
- def TestPingbackHistogram(self):
+ def testPingbackHistogram(self):
with TestDriver() as t:
t.AddChromeArg('--enable-spdy-proxy-auth')
t.SetURL('http://check.googlezip.net/test.html')
@@ -34,5 +36,6 @@ class SimpleSmoke(IntegrationTest):
print t.GetHistogram('DataReductionProxy.Pingback.Attempted')
if __name__ == '__main__':
- test = SimpleSmoke()
- test.RunAllTests()
+ # The unittest library uses sys.argv itself and is easily confused by our
+ # command line options. Pass it a simpler argv instead.
+ unittest.main(argv=[sys.argv[0]], verbosity=2)
« no previous file with comments | « tools/chrome_proxy/webdriver/common.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698