~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/selftest/__init__.py

  • Committer: Martin Pool
  • Date: 2005-06-24 09:38:25 UTC
  • Revision ID: mbp@sourcefrog.net-20050624093825-58b12e0602115358
- New helper TestBase.check_file_contents

Show diffs side-by-side

added added

removed removed

Lines of Context:
139
139
            else:
140
140
                extras.append(name)
141
141
        if shape:
142
 
            self.fail("expcted paths not found in inventory: %r" % shape)
 
142
            self.fail("expected paths not found in inventory: %r" % shape)
143
143
        if extras:
144
144
            self.fail("unexpected paths found in inventory: %r" % extras)
145
145
 
146
146
 
 
147
    def check_file_contents(self, filename, expect):
 
148
        self.log("check contents of file %s" % filename)
 
149
        contents = file(filename, 'r').read()
 
150
        if contents != expect:
 
151
            self.log("expected: %r" % expected)
 
152
            self.log("actually: %r" % contents)
 
153
            self.fail("contents of %s not as expected")
 
154
            
 
155
 
 
156
 
147
157
class InTempDir(TestBase):
148
158
    """Base class for tests run in a temporary branch."""
149
159
    def setUp(self):