~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_selftest.py

  • Committer: Martin Pool
  • Date: 2011-04-15 06:48:43 UTC
  • mto: This revision was merged to the branch mainline in revision 5789.
  • Revision ID: mbp@sourcefrog.net-20110415064843-6noebxzau7dtqvvu
Deprecate, and test, failIfExists and failUnlessExists

Show diffs side-by-side

added added

removed removed

Lines of Context:
510
510
        self.assertRaises(AssertionError, self.assertEqualStat,
511
511
            os.lstat("foo"), os.lstat("longname"))
512
512
 
 
513
    def test_failUnlessExists(self):
 
514
        """Deprecated failUnlessExists and failIfExists"""
 
515
        self.applyDeprecated(
 
516
            deprecated_in((2, 4)),
 
517
            self.failUnlessExists, '.')
 
518
        self.build_tree(['foo/', 'foo/bar'])
 
519
        self.applyDeprecated(
 
520
            deprecated_in((2, 4)),
 
521
            self.failUnlessExists, 'foo/bar')
 
522
        self.applyDeprecated(
 
523
            deprecated_in((2, 4)),
 
524
            self.failIfExists, 'foo/foo')
 
525
 
 
526
    def test_assertPathExists(self):
 
527
        self.assertPathExists('.')
 
528
        self.build_tree(['foo/', 'foo/bar'])
 
529
        self.assertPathExists('foo/bar')
 
530
        self.assertPathDoesNotExist('foo/foo')
 
531
 
513
532
 
514
533
class TestTestCaseWithMemoryTransport(tests.TestCaseWithMemoryTransport):
515
534