~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_foreign.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-10-02 18:01:05 UTC
  • mfrom: (4724.1.1 integration)
  • Revision ID: pqm@pqm.ubuntu.com-20091002180105-oeomf71t7l9gpv6g
(vila) Add a --strict option to dpush

Show diffs side-by-side

added added

removed removed

Lines of Context:
255
255
                hardlink=hardlink, stacked=stacked, source_branch=source_branch)
256
256
 
257
257
 
 
258
def register_dummy_foreign_for_test(testcase):
 
259
    bzrdir.BzrDirFormat.register_control_format(DummyForeignVcsDirFormat)
 
260
    testcase.addCleanup(bzrdir.BzrDirFormat.unregister_control_format,
 
261
                        DummyForeignVcsDirFormat)
 
262
    # We need to register the optimiser to make the dummy appears really
 
263
    # different from a regular bzr repository.
 
264
    branch.InterBranch.register_optimiser(InterToDummyVcsBranch)
 
265
    testcase.addCleanup(branch.InterBranch.unregister_optimiser,
 
266
                        InterToDummyVcsBranch)
 
267
 
 
268
 
258
269
class ForeignVcsRegistryTests(tests.TestCase):
259
270
    """Tests for the ForeignVcsRegistry class."""
260
271
 
316
327
    """Very basic test for DummyForeignVcs."""
317
328
 
318
329
    def setUp(self):
319
 
        bzrdir.BzrDirFormat.register_control_format(DummyForeignVcsDirFormat)
320
 
        branch.InterBranch.register_optimiser(InterToDummyVcsBranch)
321
 
        self.addCleanup(self.unregister)
322
330
        super(DummyForeignVcsTests, self).setUp()
323
 
 
324
 
    def unregister(self):
325
 
        try:
326
 
            bzrdir.BzrDirFormat.unregister_control_format(
327
 
                DummyForeignVcsDirFormat)
328
 
        except ValueError:
329
 
            pass
330
 
        branch.InterBranch.unregister_optimiser(InterToDummyVcsBranch)
 
331
        register_dummy_foreign_for_test(self)
331
332
 
332
333
    def test_create(self):
333
334
        """Test we can create dummies."""