| 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 scm.py.""" | 6 """Unit tests for scm.py.""" |
| 7 | 7 |
| 8 from shutil import rmtree | 8 # pylint: disable=E1101,W0403 |
| 9 import tempfile | |
| 10 | 9 |
| 11 # Fixes include path. | 10 # Fixes include path. |
| 12 from super_mox import mox, TestCaseUtils, SuperMoxTestBase | 11 from super_mox import SuperMoxTestBase |
| 13 | 12 |
| 14 import scm | 13 import scm |
| 15 | 14 |
| 16 | 15 |
| 17 class BaseTestCase(SuperMoxTestBase): | 16 class BaseTestCase(SuperMoxTestBase): |
| 18 # Like unittest's assertRaises, but checks for Gclient.Error. | 17 # Like unittest's assertRaises, but checks for Gclient.Error. |
| 19 def assertRaisesError(self, msg, fn, *args, **kwargs): | 18 def assertRaisesError(self, msg, fn, *args, **kwargs): |
| 20 try: | 19 try: |
| 21 fn(*args, **kwargs) | 20 fn(*args, **kwargs) |
| 22 except scm.gclient_utils.Error, e: | 21 except scm.gclient_utils.Error, e: |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 'Repository Root': self.root_dir, | 163 'Repository Root': self.root_dir, |
| 165 'Schedule': 'normal', | 164 'Schedule': 'normal', |
| 166 'Copied From URL': None, | 165 'Copied From URL': None, |
| 167 'Copied From Rev': None, | 166 'Copied From Rev': None, |
| 168 'Path': '.', | 167 'Path': '.', |
| 169 'Node Kind': 'directory', | 168 'Node Kind': 'directory', |
| 170 } | 169 } |
| 171 self.assertEqual(file_info, expected) | 170 self.assertEqual(file_info, expected) |
| 172 | 171 |
| 173 def testCaptureStatus(self): | 172 def testCaptureStatus(self): |
| 174 text =r"""<?xml version="1.0"?> | 173 text = r"""<?xml version="1.0"?> |
| 175 <status> | 174 <status> |
| 176 <target path="."> | 175 <target path="."> |
| 177 <entry path="unversionned_file.txt"> | 176 <entry path="unversionned_file.txt"> |
| 178 <wc-status props="none" item="unversioned"></wc-status> | 177 <wc-status props="none" item="unversioned"></wc-status> |
| 179 </entry> | 178 </entry> |
| 180 <entry path="build\internal\essential.vsprops"> | 179 <entry path="build\internal\essential.vsprops"> |
| 181 <wc-status props="normal" item="modified" revision="14628"> | 180 <wc-status props="normal" item="modified" revision="14628"> |
| 182 <commit revision="13818"> | 181 <commit revision="13818"> |
| 183 <author>ajwong@chromium.org</author> | 182 <author>ajwong@chromium.org</author> |
| 184 <date>2009-04-16T00:42:06.872358Z</date> | 183 <date>2009-04-16T00:42:06.872358Z</date> |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 self.mox.ReplayAll() | 231 self.mox.ReplayAll() |
| 233 info = scm.SVN.CaptureStatus(None) | 232 info = scm.SVN.CaptureStatus(None) |
| 234 self.assertEquals(info, []) | 233 self.assertEquals(info, []) |
| 235 | 234 |
| 236 | 235 |
| 237 if __name__ == '__main__': | 236 if __name__ == '__main__': |
| 238 import unittest | 237 import unittest |
| 239 unittest.main() | 238 unittest.main() |
| 240 | 239 |
| 241 # vim: ts=2:sw=2:tw=80:et: | 240 # vim: ts=2:sw=2:tw=80:et: |
| OLD | NEW |