/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: Canonical.com Patch Queue Manager
  • Date: 2009-03-16 02:40:46 UTC
  • mfrom: (4144.1.1 assertLength)
  • Revision ID: pqm@pqm.ubuntu.com-20090316024046-58qc87pfdgu2ugok
(robertc) New assertLength method based on one Martin has squirreled
        away somewhere. (Robert Collins, Martin Pool)

Show diffs side-by-side

added added

removed removed

Lines of Context:
902
902
        self.assertEqual(expected.st_ino, actual.st_ino)
903
903
        self.assertEqual(expected.st_mode, actual.st_mode)
904
904
 
 
905
    def assertLength(self, length, obj_with_len):
 
906
        """Assert that obj_with_len is of length length."""
 
907
        if len(obj_with_len) != length:
 
908
            self.fail("Incorrect length: wanted %d, got %d for %r" % (
 
909
                length, len(obj_with_len), obj_with_len))
 
910
 
905
911
    def assertPositive(self, val):
906
912
        """Assert that val is greater than 0."""
907
913
        self.assertTrue(val > 0, 'expected a positive value, but got %s' % val)