~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_osutils.py

  • Committer: Jelmer Vernooij
  • Date: 2012-04-16 11:08:11 UTC
  • mfrom: (6521 +trunk)
  • mto: This revision was merged to the branch mainline in revision 6522.
  • Revision ID: jelmer@samba.org-20120416110811-0y996ihqy9o2bb1t
Merge bzr.dev.

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
 
2225
2234
        self.assertTrue(
2226
2235
            osutils.find_executable_on_path('THIS SHOULD NOT EXIST') is None)
2227
2236
        self.assertTrue(osutils.find_executable_on_path('file.txt') is None)
 
2237
        
 
2238
    def test_windows_app_path(self):
 
2239
        if sys.platform != 'win32':
 
2240
            raise tests.TestSkipped('test requires win32')
 
2241
        # Override PATH env var so that exe can only be found on App Path
 
2242
        self.overrideEnv('PATH', '')
 
2243
        # Internt Explorer is always registered in the App Path
 
2244
        self.assertTrue(osutils.find_executable_on_path('iexplore') is not None)
2228
2245
 
2229
2246
    def test_other(self):
2230
2247
        if sys.platform == 'win32':