~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/codehosting/tests/helpers.py

  • Committer: Jeroen Vermeulen
  • Date: 2011-12-22 09:05:46 UTC
  • mto: This revision was merged to the branch mainline in revision 14583.
  • Revision ID: jeroen.vermeulen@canonical.com-20111222090546-6ctytqkw7zhqq1xy
Lint.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright 2009-2010 Canonical Ltd.  This software is licensed under the
 
1
# Copyright 2009-2011 Canonical Ltd.  This software is licensed under the
2
2
# GNU Affero General Public License version 3 (see the file LICENSE).
3
3
 
4
4
"""Common helpers for codehosting tests."""
112
112
    """
113
113
    def decorated(*args, **kwargs):
114
114
        d = defer.Deferred()
 
115
 
115
116
        def runInThread():
116
117
            return threads._putResultInDeferred(d, f, args, kwargs)
117
118
 
125
126
    """Return a clone of the given test."""
126
127
    from copy import deepcopy
127
128
    new_test = deepcopy(test)
 
129
 
128
130
    def make_new_test_id():
129
131
        return lambda: new_id
 
132
 
130
133
    new_test.id = make_new_test_id()
131
134
    return new_test
132
135