~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_osutils.py

  • Committer: John Arbash Meinel
  • Date: 2007-02-17 01:42:57 UTC
  • mfrom: (2293 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2294.
  • Revision ID: john@arbash-meinel.com-20070217014257-3chgn02femptf4co
[merge] bzr.dev 2293 and resolve conflicts, but still broken

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
from bzrlib import (
27
27
    errors,
28
28
    osutils,
 
29
    win32utils,
29
30
    )
30
31
from bzrlib.errors import BzrBadParameterNotUnicode, InvalidURL
31
32
from bzrlib.tests import (
314
315
    def test_abspath(self):
315
316
        self.assertEqual('C:/foo', osutils._win32_abspath('C:\\foo'))
316
317
        self.assertEqual('C:/foo', osutils._win32_abspath('C:/foo'))
 
318
        self.assertEqual('//HOST/path', osutils._win32_abspath(r'\\HOST\path'))
 
319
        self.assertEqual('//HOST/path', osutils._win32_abspath('//HOST/path'))
317
320
 
318
321
    def test_realpath(self):
319
322
        self.assertEqual('C:/foo', osutils._win32_realpath('C:\\foo'))
347
350
        self.assertEqual('H:/foo', osutils._win32_fixdrive('H:/foo'))
348
351
        self.assertEqual('C:\\foo', osutils._win32_fixdrive('c:\\foo'))
349
352
 
 
353
    def test_win98_abspath(self):
 
354
        # absolute path
 
355
        self.assertEqual('C:/foo', osutils._win98_abspath('C:\\foo'))
 
356
        self.assertEqual('C:/foo', osutils._win98_abspath('C:/foo'))
 
357
        # UNC path
 
358
        self.assertEqual('//HOST/path', osutils._win98_abspath(r'\\HOST\path'))
 
359
        self.assertEqual('//HOST/path', osutils._win98_abspath('//HOST/path'))
 
360
        # relative path
 
361
        cwd = osutils.getcwd().rstrip('/')
 
362
        drive = osutils._nt_splitdrive(cwd)[0]
 
363
        self.assertEqual(cwd+'/path', osutils._win98_abspath('path'))
 
364
        self.assertEqual(drive+'/path', osutils._win98_abspath('/path'))
 
365
        # unicode path
 
366
        u = u'\u1234'
 
367
        self.assertEqual(cwd+'/'+u, osutils._win98_abspath(u))
 
368
 
350
369
 
351
370
class TestWin32FuncsDirs(TestCaseInTempDir):
352
371
    """Test win32 functions that create files."""
353
372
    
354
373
    def test_getcwd(self):
 
374
        if win32utils.winver == 'Windows 98':
 
375
            raise TestSkipped('Windows 98 cannot handle unicode filenames')
355
376
        # Make sure getcwd can handle unicode filenames
356
377
        try:
357
378
            os.mkdir(u'mu-\xb5')