/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/__init__.py

  • Committer: Jelmer Vernooij
  • Date: 2011-04-16 08:42:21 UTC
  • mfrom: (5777.6.11 commit-lossy)
  • mto: This revision was merged to the branch mainline in revision 5792.
  • Revision ID: jelmer@samba.org-20110416084221-g9kgp1j4o9zo0kk4
merge commit-lossy

Show diffs side-by-side

added added

removed removed

Lines of Context:
1444
1444
 
1445
1445
    def assertFileEqual(self, content, path):
1446
1446
        """Fail if path does not contain 'content'."""
1447
 
        self.failUnlessExists(path)
 
1447
        self.assertPathExists(path)
1448
1448
        f = file(path, 'rb')
1449
1449
        try:
1450
1450
            s = f.read()
1460
1460
        else:
1461
1461
            self.assertEqual(expected_docstring, obj.__doc__)
1462
1462
 
 
1463
    @symbol_versioning.deprecated_method(symbol_versioning.deprecated_in((2, 4)))
1463
1464
    def failUnlessExists(self, path):
 
1465
        return self.assertPathExists(path)
 
1466
 
 
1467
    def assertPathExists(self, path):
1464
1468
        """Fail unless path or paths, which may be abs or relative, exist."""
1465
1469
        if not isinstance(path, basestring):
1466
1470
            for p in path:
1467
 
                self.failUnlessExists(p)
 
1471
                self.assertPathExists(p)
1468
1472
        else:
1469
 
            self.failUnless(osutils.lexists(path),path+" does not exist")
 
1473
            self.assertTrue(osutils.lexists(path),
 
1474
                path + " does not exist")
1470
1475
 
 
1476
    @symbol_versioning.deprecated_method(symbol_versioning.deprecated_in((2, 4)))
1471
1477
    def failIfExists(self, path):
 
1478
        return self.assertPathDoesNotExist(path)
 
1479
 
 
1480
    def assertPathDoesNotExist(self, path):
1472
1481
        """Fail if path or paths, which may be abs or relative, exist."""
1473
1482
        if not isinstance(path, basestring):
1474
1483
            for p in path:
1475
 
                self.failIfExists(p)
 
1484
                self.assertPathDoesNotExist(p)
1476
1485
        else:
1477
 
            self.failIf(osutils.lexists(path),path+" exists")
 
1486
            self.assertFalse(osutils.lexists(path),
 
1487
                path + " exists")
1478
1488
 
1479
1489
    def _capture_deprecation_warnings(self, a_callable, *args, **kwargs):
1480
1490
        """A helper for callDeprecated and applyDeprecated.