~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_osutils.py

  • Committer: Aaron Bentley
  • Date: 2007-02-16 07:02:19 UTC
  • mfrom: (2292 +trunk)
  • mto: (2255.6.1 dirstate)
  • mto: This revision was merged to the branch mainline in revision 2322.
  • Revision ID: aaron.bentley@utoronto.ca-20070216070219-b22k0gwnisnxawnk
Merged bzr.dev (17 tests failing)

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 (
266
267
    def test_abspath(self):
267
268
        self.assertEqual('C:/foo', osutils._win32_abspath('C:\\foo'))
268
269
        self.assertEqual('C:/foo', osutils._win32_abspath('C:/foo'))
 
270
        self.assertEqual('//HOST/path', osutils._win32_abspath(r'\\HOST\path'))
 
271
        self.assertEqual('//HOST/path', osutils._win32_abspath('//HOST/path'))
269
272
 
270
273
    def test_realpath(self):
271
274
        self.assertEqual('C:/foo', osutils._win32_realpath('C:\\foo'))
299
302
        self.assertEqual('H:/foo', osutils._win32_fixdrive('H:/foo'))
300
303
        self.assertEqual('C:\\foo', osutils._win32_fixdrive('c:\\foo'))
301
304
 
 
305
    def test_win98_abspath(self):
 
306
        # absolute path
 
307
        self.assertEqual('C:/foo', osutils._win98_abspath('C:\\foo'))
 
308
        self.assertEqual('C:/foo', osutils._win98_abspath('C:/foo'))
 
309
        # UNC path
 
310
        self.assertEqual('//HOST/path', osutils._win98_abspath(r'\\HOST\path'))
 
311
        self.assertEqual('//HOST/path', osutils._win98_abspath('//HOST/path'))
 
312
        # relative path
 
313
        cwd = osutils.getcwd().rstrip('/')
 
314
        drive = osutils._nt_splitdrive(cwd)[0]
 
315
        self.assertEqual(cwd+'/path', osutils._win98_abspath('path'))
 
316
        self.assertEqual(drive+'/path', osutils._win98_abspath('/path'))
 
317
        # unicode path
 
318
        u = u'\u1234'
 
319
        self.assertEqual(cwd+'/'+u, osutils._win98_abspath(u))
 
320
 
302
321
 
303
322
class TestWin32FuncsDirs(TestCaseInTempDir):
304
323
    """Test win32 functions that create files."""
305
324
    
306
325
    def test_getcwd(self):
 
326
        if win32utils.winver == 'Windows 98':
 
327
            raise TestSkipped('Windows 98 cannot handle unicode filenames')
307
328
        # Make sure getcwd can handle unicode filenames
308
329
        try:
309
330
            os.mkdir(u'mu-\xb5')