~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/__init__.py

  • Committer: Andrew Bennetts
  • Date: 2011-04-08 03:31:54 UTC
  • mfrom: (5766 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5767.
  • Revision ID: andrew.bennetts@canonical.com-20110408033154-la08nghd4391sw5m
Merge latest lp:bzr, move our new release notes entries to the current release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1000
1000
        for key, (parent, name) in known_hooks.iter_parent_objects():
1001
1001
            current_hooks = getattr(parent, name)
1002
1002
            self._preserved_hooks[parent] = (name, current_hooks)
 
1003
        self._preserved_lazy_hooks = hooks._lazy_hooks
 
1004
        hooks._lazy_hooks = {}
1003
1005
        self.addCleanup(self._restoreHooks)
1004
1006
        for key, (parent, name) in known_hooks.iter_parent_objects():
1005
1007
            factory = known_hooks.get(key)
1265
1267
                         'st_mtime did not match')
1266
1268
        self.assertEqual(expected.st_ctime, actual.st_ctime,
1267
1269
                         'st_ctime did not match')
1268
 
        if sys.platform != 'win32':
 
1270
        if sys.platform == 'win32':
1269
1271
            # On Win32 both 'dev' and 'ino' cannot be trusted. In python2.4 it
1270
1272
            # is 'dev' that varies, in python 2.5 (6?) it is st_ino that is
1271
 
            # odd. Regardless we shouldn't actually try to assert anything
1272
 
            # about their values
 
1273
            # odd. We just force it to always be 0 to avoid any problems.
 
1274
            self.assertEqual(0, expected.st_dev)
 
1275
            self.assertEqual(0, actual.st_dev)
 
1276
            self.assertEqual(0, expected.st_ino)
 
1277
            self.assertEqual(0, actual.st_ino)
 
1278
        else:
1273
1279
            self.assertEqual(expected.st_dev, actual.st_dev,
1274
1280
                             'st_dev did not match')
1275
1281
            self.assertEqual(expected.st_ino, actual.st_ino,
1657
1663
    def _restoreHooks(self):
1658
1664
        for klass, (name, hooks) in self._preserved_hooks.items():
1659
1665
            setattr(klass, name, hooks)
 
1666
        hooks._lazy_hooks = self._preserved_lazy_hooks
1660
1667
 
1661
1668
    def knownFailure(self, reason):
1662
1669
        """This test has failed for some known reason."""