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

Side by Side Diff: tests/trychange_unittest.py

Issue 133933007: trychange.py: Use urllib2's urlopen() instead of urllib's. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Remove --proxy support Created 6 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | trychange.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 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """Unit tests for trychange.py.""" 6 """Unit tests for trychange.py."""
7 7
8 import os 8 import os
9 import sys 9 import sys
10 import unittest 10 import unittest
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 class TryChangeUnittest(TryChangeTestsBase): 45 class TryChangeUnittest(TryChangeTestsBase):
46 """General trychange.py tests.""" 46 """General trychange.py tests."""
47 def testMembersChanged(self): 47 def testMembersChanged(self):
48 members = [ 48 members = [
49 'DieWithError', 'EPILOG', 'Escape', 'GIT', 'GetMungedDiff', 'GuessVCS', 49 'DieWithError', 'EPILOG', 'Escape', 'GIT', 'GetMungedDiff', 'GuessVCS',
50 'HELP_STRING', 'InvalidScript', 'NoTryServerAccess', 'OptionParser', 50 'HELP_STRING', 'InvalidScript', 'NoTryServerAccess', 'OptionParser',
51 'PrintSuccess', 51 'PrintSuccess',
52 'RunCommand', 'RunGit', 'SCM', 'SVN', 'TryChange', 'USAGE', 'breakpad', 52 'RunCommand', 'RunGit', 'SCM', 'SVN', 'TryChange', 'USAGE', 'breakpad',
53 'datetime', 'errno', 'fix_encoding', 'gcl', 'gclient_utils', 'gen_parser', 53 'datetime', 'errno', 'fix_encoding', 'gcl', 'gclient_utils', 'gen_parser',
54 'getpass', 'itertools', 'json', 'logging', 'optparse', 'os', 'posixpath', 54 'getpass', 'itertools', 'json', 'logging', 'optparse', 'os', 'posixpath',
55 're', 'scm', 'shutil', 'subprocess2', 'sys', 'tempfile', 'urllib'] 55 're', 'scm', 'shutil', 'subprocess2', 'sys', 'tempfile', 'urllib',
56 'urllib2']
56 # If this test fails, you should add the relevant test. 57 # If this test fails, you should add the relevant test.
57 self.compareMembers(trychange, members) 58 self.compareMembers(trychange, members)
58 59
59 60
60 class TryChangeSimpleTest(unittest.TestCase): 61 class TryChangeSimpleTest(unittest.TestCase):
61 # Doesn't require supermox to run. 62 # Doesn't require supermox to run.
62 def test_flags(self): 63 def test_flags(self):
63 cmd = [ 64 cmd = [
64 '--bot', 'bot1,bot2', 65 '--bot', 'bot1,bot2',
65 '--testfilter', 'test1', 66 '--testfilter', 'test1',
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 trychange.scm.GIT.GetEmail(self.fake_root).AndReturn('georges@example.com') 150 trychange.scm.GIT.GetEmail(self.fake_root).AndReturn('georges@example.com')
150 self.mox.ReplayAll() 151 self.mox.ReplayAll()
151 git = trychange.GIT(self.options, self.fake_root, self.options.files) 152 git = trychange.GIT(self.options, self.fake_root, self.options.files)
152 self.assertEqual(git.GetFileNames(), self.expected_files) 153 self.assertEqual(git.GetFileNames(), self.expected_files)
153 self.assertEqual(git.checkout_root, self.fake_root) 154 self.assertEqual(git.checkout_root, self.fake_root)
154 self.assertEqual(git.GenerateDiff(), 'A diff') 155 self.assertEqual(git.GenerateDiff(), 'A diff')
155 156
156 157
157 if __name__ == '__main__': 158 if __name__ == '__main__':
158 unittest.main() 159 unittest.main()
OLDNEW
« 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