~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/plugins/launchpad/test_lp_api.py

  • Committer: Vincent Ladeuil
  • Date: 2010-01-26 10:17:22 UTC
  • mfrom: (4985.1.5 add-attr-cleanup)
  • mto: This revision was merged to the branch mainline in revision 4988.
  • Revision ID: v.ladeuil+lp@free.fr-20100126101722-y213sv39buw3dgi2
Implement TestCase.overrideAttr to simplify tests setUp/cleanup

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
 
40
40
    def patch(self, obj, name, value):
41
41
        """Temporarily set the 'name' attribute of 'obj' to 'value'."""
42
 
        real_value = getattr(obj, name)
43
 
        setattr(obj, name, value)
44
 
        self.addCleanup(setattr, obj, name, real_value)
 
42
        self.overrideAttr(obj, name, value)
45
43
 
46
44
    def test_get_launchpadlib_version(self):
47
45
        # parse_launchpadlib_version returns a tuple of a version number of