/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

(vila) Release 2.3.3 (Vincent Ladeuil)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1434
1434
 
1435
1435
    def assertFileEqual(self, content, path):
1436
1436
        """Fail if path does not contain 'content'."""
1437
 
        self.failUnlessExists(path)
 
1437
        self.assertPathExists(path)
1438
1438
        f = file(path, 'rb')
1439
1439
        try:
1440
1440
            s = f.read()
1450
1450
        else:
1451
1451
            self.assertEqual(expected_docstring, obj.__doc__)
1452
1452
 
 
1453
    @symbol_versioning.deprecated_method(symbol_versioning.deprecated_in((2, 4)))
1453
1454
    def failUnlessExists(self, path):
 
1455
        return self.assertPathExists(path)
 
1456
 
 
1457
    def assertPathExists(self, path):
1454
1458
        """Fail unless path or paths, which may be abs or relative, exist."""
1455
1459
        if not isinstance(path, basestring):
1456
1460
            for p in path:
1457
 
                self.failUnlessExists(p)
 
1461
                self.assertPathExists(p)
1458
1462
        else:
1459
 
            self.failUnless(osutils.lexists(path),path+" does not exist")
 
1463
            self.assertTrue(osutils.lexists(path),
 
1464
                path + " does not exist")
1460
1465
 
 
1466
    @symbol_versioning.deprecated_method(symbol_versioning.deprecated_in((2, 4)))
1461
1467
    def failIfExists(self, path):
 
1468
        return self.assertPathDoesNotExist(path)
 
1469
 
 
1470
    def assertPathDoesNotExist(self, path):
1462
1471
        """Fail if path or paths, which may be abs or relative, exist."""
1463
1472
        if not isinstance(path, basestring):
1464
1473
            for p in path:
1465
 
                self.failIfExists(p)
 
1474
                self.assertPathDoesNotExist(p)
1466
1475
        else:
1467
 
            self.failIf(osutils.lexists(path),path+" exists")
 
1476
            self.assertFalse(osutils.lexists(path),
 
1477
                path + " exists")
1468
1478
 
1469
1479
    def _capture_deprecation_warnings(self, a_callable, *args, **kwargs):
1470
1480
        """A helper for callDeprecated and applyDeprecated.