~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: 2006-07-03 16:13:21 UTC
  • mto: This revision was merged to the branch mainline in revision 1851.
  • Revision ID: john@arbash-meinel.com-20060703161321-4d880cc5bca7f670
Create a mac version of 'getcwd()' which normalizes the path.

Show diffs side-by-side

added added

removed removed

Lines of Context:
227
227
        self.assertFileEqual('baz\n', 'a')
228
228
 
229
229
 
 
230
class TestMacFuncsDirs(TestCaseInTempDir):
 
231
    """Test mac special functions that require directories."""
 
232
 
 
233
    def test_getcwd(self):
 
234
        # On Mac, this will actually create Ba\u030agfors
 
235
        # but chdir will still work, because it accepts both paths
 
236
        try:
 
237
            os.mkdir(u'B\xe5gfors')
 
238
        except UnicodeError:
 
239
            raise TestSkipped("Unable to create Unicode filename")
 
240
 
 
241
        os.chdir(u'B\xe5gfors')
 
242
        self.assertEndsWith(osutils._mac_getcwd(), u'B\xe5gfors')
 
243
 
 
244
    def test_getcwd_nonnorm(self):
 
245
        # Test that _mac_getcwd() will normalize this path
 
246
        try:
 
247
            os.mkdir(u'Ba\u030agfors')
 
248
        except UnicodeError:
 
249
            raise TestSkipped("Unable to create Unicode filename")
 
250
 
 
251
        os.chdir(u'Ba\u030agfors')
 
252
        self.assertEndsWith(osutils._mac_getcwd(), u'B\xe5gfors')
 
253
 
230
254
class TestSplitLines(TestCase):
231
255
 
232
256
    def test_split_unicode(self):