~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_osutils.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-01-13 05:14:24 UTC
  • mfrom: (3936.1.3 integration)
  • Revision ID: pqm@pqm.ubuntu.com-20090113051424-nrk3zkfe09h46i9y
(mbp) merge 1.11 and advance to 1.12

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
        pathjoin,
38
38
        pumpfile,
39
39
        pump_string_file,
 
40
        canonical_relpath,
40
41
        )
41
42
from bzrlib.tests import (
42
43
        adapt_tests,
45
46
        split_suite_by_re,
46
47
        StringIOWrapper,
47
48
        SymlinkFeature,
 
49
        CaseInsCasePresFilenameFeature,
48
50
        TestCase,
49
51
        TestCaseInTempDir,
50
52
        TestScenarioApplier,
356
358
        osutils.host_os_dereferences_symlinks()
357
359
 
358
360
 
 
361
class TestCanonicalRelPath(TestCaseInTempDir):
 
362
 
 
363
    _test_needs_features = [CaseInsCasePresFilenameFeature]
 
364
 
 
365
    def test_canonical_relpath_simple(self):
 
366
        f = file('MixedCaseName', 'w')
 
367
        f.close()
 
368
        self.failUnlessEqual(
 
369
            canonical_relpath(self.test_base_dir, 'mixedcasename'),
 
370
            'work/MixedCaseName')
 
371
 
 
372
    def test_canonical_relpath_missing_tail(self):
 
373
        os.mkdir('MixedCaseParent')
 
374
        self.failUnlessEqual(
 
375
            canonical_relpath(self.test_base_dir, 'mixedcaseparent/nochild'),
 
376
            'work/MixedCaseParent/nochild')
 
377
 
 
378
 
359
379
class TestPumpFile(TestCase):
360
380
    """Test pumpfile method."""
361
381
    def setUp(self):