~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/per_interbranch/__init__.py

  • Committer: Alexander Belchenko
  • Date: 2010-06-17 08:53:15 UTC
  • mfrom: (5300 +trunk)
  • mto: (5303.2.1 integration)
  • mto: This revision was merged to the branch mainline in revision 5305.
  • Revision ID: bialix@ukr.net-20100617085315-hr8186zck57zn35s
merge bzr.dev; fix NEWS

Show diffs side-by-side

added added

removed removed

Lines of Context:
144
144
        return newbranch.bzrdir
145
145
 
146
146
 
 
147
class StubWithFormat(object):
 
148
    """A stub object used to check that convenience methods call Inter's."""
 
149
 
 
150
    _format = object()
 
151
 
 
152
 
 
153
class StubMatchingInter(object):
 
154
    """An inter for tests.
 
155
 
 
156
    This is not a subclass of InterBranch so that missing methods are caught
 
157
    and added rather than actually trying to do something.
 
158
    """
 
159
 
 
160
    _uses = []
 
161
 
 
162
    def __init__(self, source, target):
 
163
        self.source = source
 
164
        self.target = target
 
165
 
 
166
    @classmethod
 
167
    def is_compatible(klass, source, target):
 
168
        return StubWithFormat._format in (source._format, target._format)
 
169
 
 
170
    def copy_content_into(self, *args, **kwargs):
 
171
        self.__class__._uses.append(
 
172
            (self, 'copy_content_into', args, kwargs))
 
173
 
 
174
 
147
175
def load_tests(standard_tests, module, loader):
148
176
    submod_tests = loader.loadTestsFromModuleNames([
 
177
        'bzrlib.tests.per_interbranch.test_get',
 
178
        'bzrlib.tests.per_interbranch.test_copy_content_into',
149
179
        'bzrlib.tests.per_interbranch.test_pull',
150
180
        'bzrlib.tests.per_interbranch.test_push',
151
181
        'bzrlib.tests.per_interbranch.test_update_revisions',