~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/__init__.py

  • Committer: Martin Pool
  • Date: 2008-01-29 06:06:11 UTC
  • mto: This revision was merged to the branch mainline in revision 3219.
  • Revision ID: mbp@sourcefrog.net-20080129060611-clv6gh4ijuawhjvy
Add test_push_log_file

Show diffs side-by-side

added added

removed removed

Lines of Context:
1048
1048
            f.close()
1049
1049
        self.assertEqualDiff(content, s)
1050
1050
 
 
1051
    def failUnlessExists(self, path):
 
1052
        """Fail unless path or paths, which may be abs or relative, exist."""
 
1053
        if not isinstance(path, basestring):
 
1054
            for p in path:
 
1055
                self.failUnlessExists(p)
 
1056
        else:
 
1057
            self.failUnless(osutils.lexists(path),path+" does not exist")
 
1058
 
 
1059
    def failIfExists(self, path):
 
1060
        """Fail if path or paths, which may be abs or relative, exist."""
 
1061
        if not isinstance(path, basestring):
 
1062
            for p in path:
 
1063
                self.failIfExists(p)
 
1064
        else:
 
1065
            self.failIf(osutils.lexists(path),path+" exists")
 
1066
 
1051
1067
    def _capture_deprecation_warnings(self, a_callable, *args, **kwargs):
1052
1068
        """A helper for callDeprecated and applyDeprecated.
1053
1069
 
2093
2109
    def build_tree_contents(self, shape):
2094
2110
        build_tree_contents(shape)
2095
2111
 
2096
 
    def failUnlessExists(self, path):
2097
 
        """Fail unless path or paths, which may be abs or relative, exist."""
2098
 
        if not isinstance(path, basestring):
2099
 
            for p in path:
2100
 
                self.failUnlessExists(p)
2101
 
        else:
2102
 
            self.failUnless(osutils.lexists(path),path+" does not exist")
2103
 
 
2104
 
    def failIfExists(self, path):
2105
 
        """Fail if path or paths, which may be abs or relative, exist."""
2106
 
        if not isinstance(path, basestring):
2107
 
            for p in path:
2108
 
                self.failIfExists(p)
2109
 
        else:
2110
 
            self.failIf(osutils.lexists(path),path+" exists")
2111
 
 
2112
2112
    def assertInWorkingTree(self, path, root_path='.', tree=None):
2113
2113
        """Assert whether path or paths are in the WorkingTree"""
2114
2114
        if tree is None: