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

Unified Diff: tests/trychange_unittest.py

Issue 9599012: Stop sending the testfilter= flag to the try server and process it locally. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Fix test to not hardcode my email address! Created 8 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | trychange.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/trychange_unittest.py
diff --git a/tests/trychange_unittest.py b/tests/trychange_unittest.py
index f483664a5f690b68b8eaa0392bf9f28d4c4319bd..bcb568abf907a29680fa7e65ec85453559c04136 100755
--- a/tests/trychange_unittest.py
+++ b/tests/trychange_unittest.py
@@ -7,6 +7,7 @@
import os
import sys
+import unittest
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
@@ -49,7 +50,7 @@ class TryChangeUnittest(TryChangeTestsBase):
'InvalidScript', 'NoTryServerAccess', 'PrintSuccess', 'SCM', 'SVN',
'TryChange', 'USAGE',
'breakpad', 'datetime', 'errno', 'fix_encoding', 'gcl', 'gclient_utils',
- 'getpass',
+ 'getpass', 'gen_parser',
'json', 'logging', 'optparse', 'os', 'posixpath', 're', 'scm', 'shutil',
'subprocess2', 'sys', 'tempfile', 'urllib',
]
@@ -57,6 +58,46 @@ class TryChangeUnittest(TryChangeTestsBase):
self.compareMembers(trychange, members)
+class TryChangeSimpleTest(unittest.TestCase):
+ # Doesn't require supermox to run.
+ def test_flags(self):
+ cmd = [
+ '--bot', 'bot1',
+ '--testfilter', 'test1',
+ '--bot', 'bot2',
+ '--testfilter', 'test2',
+ '--user', 'joe',
+ '--email', 'joe@example.com',
+ ]
+ options, args = trychange.gen_parser(None).parse_args(cmd)
+ self.assertEquals([], args)
+ # pylint: disable=W0212
+ values = trychange._ParseSendChangeOptions(options)
+ self.assertEquals(
+ [
+ ('user', 'joe'),
+ ('name', None),
+ ('email', 'joe@example.com'),
+ ('bot', 'bot1:test1,test2'),
+ ('bot', 'bot2:test1,test2'),
+ ],
+ values)
+
+ def test_flags_bad_combination(self):
+ cmd = [
+ '--bot', 'bot1:test1',
+ '--testfilter', 'test2',
+ ]
+ options, args = trychange.gen_parser(None).parse_args(cmd)
+ self.assertEquals([], args)
+ try:
+ # pylint: disable=W0212
+ trychange._ParseSendChangeOptions(options)
+ self.fail()
+ except ValueError:
+ pass
+
+
class SVNUnittest(TryChangeTestsBase):
"""trychange.SVN tests."""
def testMembersChanged(self):
@@ -111,5 +152,4 @@ class GITUnittest(TryChangeTestsBase):
if __name__ == '__main__':
- import unittest
unittest.main()
« no previous file with comments | « no previous file | trychange.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698