~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/__init__.py

  • Committer: Robert Collins
  • Date: 2008-09-22 05:15:20 UTC
  • mto: (3696.5.1 commit-updates)
  • mto: This revision was merged to the branch mainline in revision 3741.
  • Revision ID: robertc@robertcollins.net-20080922051520-uhr3pn61w141kagv
Race-free stat-fingerprint updating during commit via a new method get_file_with_stat.

Show diffs side-by-side

added added

removed removed

Lines of Context:
874
874
        self.assertEqual(mode, mode_test,
875
875
                         'mode mismatch %o != %o' % (mode, mode_test))
876
876
 
 
877
    def assertEqualStat(self, expected, actual):
 
878
        """assert that expected and actual are the same stat result.
 
879
 
 
880
        :param expected: A stat result.
 
881
        :param actual: A stat result.
 
882
        :raises AssertionError: If the expected and actual stat values differ
 
883
            other than by atime.
 
884
        """
 
885
        self.assertEqual(expected.st_size, actual.st_size)
 
886
        self.assertEqual(expected.st_mtime, actual.st_mtime)
 
887
        self.assertEqual(expected.st_ctime, actual.st_ctime)
 
888
        self.assertEqual(expected.st_dev, actual.st_dev)
 
889
        self.assertEqual(expected.st_ino, actual.st_ino)
 
890
        self.assertEqual(expected.st_mode, actual.st_mode)
 
891
 
877
892
    def assertPositive(self, val):
878
893
        """Assert that val is greater than 0."""
879
894
        self.assertTrue(val > 0, 'expected a positive value, but got %s' % val)