OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 # Copyright (c) 2009 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2009 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 optparse | 8 import optparse |
9 | 9 |
10 # Local imports | 10 # Local imports |
(...skipping 21 matching lines...) Expand all Loading... |
32 self.options.files = self.expected_files | 32 self.options.files = self.expected_files |
33 self.options.diff = None | 33 self.options.diff = None |
34 self.options.name = None | 34 self.options.name = None |
35 self.options.email = None | 35 self.options.email = None |
36 | 36 |
37 | 37 |
38 class TryChangeUnittest(TryChangeTestsBase): | 38 class TryChangeUnittest(TryChangeTestsBase): |
39 """General trychange.py tests.""" | 39 """General trychange.py tests.""" |
40 def testMembersChanged(self): | 40 def testMembersChanged(self): |
41 members = [ | 41 members = [ |
42 'EscapeDot', 'GIT', 'GuessVCS', | 42 'EscapeDot', 'GIT', 'GuessVCS', 'GetMungedDiff', |
43 'HELP_STRING', 'InvalidScript', 'NoTryServerAccess', 'PrintSuccess', | 43 'HELP_STRING', 'InvalidScript', 'NoTryServerAccess', 'PrintSuccess', |
44 'SCM', 'SVN', 'TryChange', 'USAGE', | 44 'SCM', 'SVN', 'TryChange', 'USAGE', |
45 'breakpad', 'datetime', 'errno', 'gclient_utils', 'getpass', 'logging', | 45 'breakpad', 'datetime', 'errno', 'gclient_utils', 'getpass', 'logging', |
46 'optparse', 'os', 'posixpath', 'scm', 'shutil', 'sys', 'tempfile', | 46 'optparse', 'os', 'posixpath', 'scm', 'shutil', 'sys', 'tempfile', |
47 'urllib', | 47 'urllib', |
48 ] | 48 ] |
49 # If this test fails, you should add the relevant test. | 49 # If this test fails, you should add the relevant test. |
50 self.compareMembers(trychange, members) | 50 self.compareMembers(trychange, members) |
51 | 51 |
52 | 52 |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 self.mox.ReplayAll() | 96 self.mox.ReplayAll() |
97 git = trychange.GIT(self.options, self.fake_root) | 97 git = trychange.GIT(self.options, self.fake_root) |
98 self.assertEqual(git.GetFileNames(), self.expected_files) | 98 self.assertEqual(git.GetFileNames(), self.expected_files) |
99 self.assertEqual(git.checkout_root, self.fake_root) | 99 self.assertEqual(git.checkout_root, self.fake_root) |
100 self.assertEqual(git.GenerateDiff(), 'A diff') | 100 self.assertEqual(git.GenerateDiff(), 'A diff') |
101 | 101 |
102 | 102 |
103 if __name__ == '__main__': | 103 if __name__ == '__main__': |
104 import unittest | 104 import unittest |
105 unittest.main() | 105 unittest.main() |
OLD | NEW |