~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_osutils.py

  • Committer: Patch Queue Manager
  • Date: 2012-03-12 19:01:05 UTC
  • mfrom: (6468.6.2 492144-rename-wrapper)
  • Revision ID: pqm@pqm.ubuntu.com-20120312190105-p9dg7dxetifq1k0w
(gz) Implement osutils._rename_wrap_exception for recording both filenames
 in the error (Ross Lagerwall)

Show diffs side-by-side

added added

removed removed

Lines of Context:
181
181
        shape = sorted(os.listdir('.'))
182
182
        self.assertEquals(['A', 'B'], shape)
183
183
 
 
184
    def test_rename_exception(self):
 
185
        try:
 
186
            osutils.rename('nonexistent_path', 'different_nonexistent_path')
 
187
        except OSError, e:
 
188
            self.assertEqual(e.old_filename, 'nonexistent_path')
 
189
            self.assertEqual(e.new_filename, 'different_nonexistent_path')
 
190
            self.assertTrue('nonexistent_path' in e.strerror)
 
191
            self.assertTrue('different_nonexistent_path' in e.strerror)
 
192
 
184
193
 
185
194
class TestRandChars(tests.TestCase):
186
195