| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 # Copyright (c) 2010 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2010 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 # Fixes include path. | 8 # Fixes include path. |
| 9 from super_mox import mox, SuperMoxTestBase | 9 from super_mox import mox, SuperMoxTestBase |
| 10 | 10 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 self.options.exclude = [] | 35 self.options.exclude = [] |
| 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', 'GetMungedDiff', | 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', 'json', |
| 46 'optparse', 'os', 'posixpath', 're', 'scm', 'shutil', 'sys', 'tempfile', | 46 'logging', 'optparse', 'os', 'posixpath', 're', 'scm', 'shutil', 'sys', |
| 47 'urllib', | 47 'tempfile', '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 |
| 53 class SVNUnittest(TryChangeTestsBase): | 53 class SVNUnittest(TryChangeTestsBase): |
| 54 """trychange.SVN tests.""" | 54 """trychange.SVN tests.""" |
| 55 def testMembersChanged(self): | 55 def testMembersChanged(self): |
| 56 members = [ | 56 members = [ |
| 57 'AutomagicalSettings', 'GclStyleSettings', 'GclientStyleSettings', | 57 'AutomagicalSettings', 'GclStyleSettings', 'GclientStyleSettings', |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 self.mox.ReplayAll() | 97 self.mox.ReplayAll() |
| 98 git = trychange.GIT(self.options, self.fake_root) | 98 git = trychange.GIT(self.options, self.fake_root) |
| 99 self.assertEqual(git.GetFileNames(), self.expected_files) | 99 self.assertEqual(git.GetFileNames(), self.expected_files) |
| 100 self.assertEqual(git.checkout_root, self.fake_root) | 100 self.assertEqual(git.checkout_root, self.fake_root) |
| 101 self.assertEqual(git.GenerateDiff(), 'A diff') | 101 self.assertEqual(git.GenerateDiff(), 'A diff') |
| 102 | 102 |
| 103 | 103 |
| 104 if __name__ == '__main__': | 104 if __name__ == '__main__': |
| 105 import unittest | 105 import unittest |
| 106 unittest.main() | 106 unittest.main() |
| OLD | NEW |