~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: 2009-07-24 18:26:21 UTC
  • mfrom: (4567 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4568.
  • Revision ID: john@arbash-meinel.com-20090724182621-68s2jhoqf3pn72n7
Merge bzr.dev 4567 to resolve NEWS

Show diffs side-by-side

added added

removed removed

Lines of Context:
625
625
        self.assertEqual("1234", output.getvalue())
626
626
 
627
627
 
 
628
class TestRelpath(tests.TestCase):
 
629
 
 
630
    def test_simple_relpath(self):
 
631
        cwd = osutils.getcwd()
 
632
        subdir = cwd + '/subdir'
 
633
        self.assertEqual('subdir', osutils.relpath(cwd, subdir))
 
634
 
 
635
    def test_deep_relpath(self):
 
636
        cwd = osutils.getcwd()
 
637
        subdir = cwd + '/sub/subsubdir'
 
638
        self.assertEqual('sub/subsubdir', osutils.relpath(cwd, subdir))
 
639
 
 
640
    def test_not_relative(self):
 
641
        self.assertRaises(errors.PathNotChild,
 
642
                          osutils.relpath, 'C:/path', 'H:/path')
 
643
        self.assertRaises(errors.PathNotChild,
 
644
                          osutils.relpath, 'C:/', 'H:/path')
 
645
 
 
646
 
628
647
class TestSafeUnicode(tests.TestCase):
629
648
 
630
649
    def test_from_ascii_string(self):