~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_bundle.py

  • Committer: Aaron Bentley
  • Date: 2006-09-20 18:41:51 UTC
  • mto: This revision was merged to the branch mainline in revision 2048.
  • Revision ID: abentley@panoramicfeedback.com-20060920184151-6ad695cf843a746b
Ensure that 0.8 bundles aren't used with KnitRepository2

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
import sys
20
20
import tempfile
21
21
 
22
 
from bzrlib import inventory
 
22
from bzrlib import bzrdir, errors, inventory, repository
23
23
from bzrlib.builtins import merge
24
24
from bzrlib.bzrdir import BzrDir
25
25
from bzrlib.bundle.apply_bundle import install_bundle, merge_bundle
26
26
from bzrlib.bundle.bundle_data import BundleTree
27
27
from bzrlib.bundle.serializer import write_bundle, read_bundle
 
28
from bzrlib.bundle.serializer.v08 import BundleSerializerV08
28
29
from bzrlib.branch import Branch
29
30
from bzrlib.diff import internal_diff
30
31
from bzrlib.errors import (BzrError, TestamentMismatch, NotABundle, BadBundle, 
301
302
            [inventory.ROOT_ID, 'a', 'b', 'd', 'e'])
302
303
 
303
304
 
 
305
class BundleTester1(TestCaseWithTransport):
 
306
 
 
307
    def test_mismatched_bundle(self):
 
308
        format = bzrdir.BzrDirMetaFormat1()
 
309
        format.repository_format = repository.RepositoryFormatKnit2()
 
310
        serializer = BundleSerializerV08('0.8')
 
311
        b = self.make_branch('.', format=format)
 
312
        self.assertRaises(errors.IncompatibleFormat, serializer.write, 
 
313
                          b.repository, [], {}, StringIO())
 
314
 
304
315
class BundleTester(TestCaseWithTransport):
305
316
 
306
317
    def create_bundle_text(self, base_rev_id, rev_id):