~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_versionedfile.py

  • Committer: Aaron Bentley
  • Date: 2007-09-02 22:38:54 UTC
  • mfrom: (2776 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2777.
  • Revision ID: aaron.bentley@utoronto.ca-20070902223854-vh6jc4c19w94htsm
Merge bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
from bzrlib.knit import (
38
38
    KnitVersionedFile,
39
39
    KnitAnnotateFactory,
40
 
    KnitPlainFactory
 
40
    KnitPlainFactory,
41
41
    )
42
 
from bzrlib.tests import TestCaseWithTransport, TestSkipped
 
42
from bzrlib.tests import TestCaseWithMemoryTransport, TestSkipped
43
43
from bzrlib.tests.HTTPTestUtil import TestCaseWithWebserver
44
44
from bzrlib.trace import mutter
45
45
from bzrlib.transport import get_transport
829
829
                          vf.get_sha1s(['a', 'c', 'b']))
830
830
        
831
831
 
832
 
class TestWeave(TestCaseWithTransport, VersionedFileTestMixIn):
 
832
class TestWeave(TestCaseWithMemoryTransport, VersionedFileTestMixIn):
833
833
 
834
834
    def get_file(self, name='foo'):
835
835
        return WeaveFile(name, get_transport(self.get_url('.')), create=True)
881
881
        return WeaveFile
882
882
 
883
883
 
884
 
class TestKnit(TestCaseWithTransport, VersionedFileTestMixIn):
 
884
class TestKnit(TestCaseWithMemoryTransport, VersionedFileTestMixIn):
885
885
 
886
886
    def get_file(self, name='foo'):
887
887
        return self.get_factory()(name, get_transport(self.get_url('.')),
943
943
# if we make the registry a separate class though we still need to 
944
944
# test the behaviour in the active registry to catch failure-to-handle-
945
945
# stange-objects
946
 
class TestInterVersionedFile(TestCaseWithTransport):
 
946
class TestInterVersionedFile(TestCaseWithMemoryTransport):
947
947
 
948
948
    def test_get_default_inter_versionedfile(self):
949
949
        # test that the InterVersionedFile.get(a, b) probes
1263
1263
        self._test_merge_from_strings(base, a, b, result)
1264
1264
 
1265
1265
 
1266
 
class TestKnitMerge(TestCaseWithTransport, MergeCasesMixin):
 
1266
class TestKnitMerge(TestCaseWithMemoryTransport, MergeCasesMixin):
1267
1267
 
1268
1268
    def get_file(self, name='foo'):
1269
1269
        return KnitVersionedFile(name, get_transport(self.get_url('.')),
1273
1273
        pass
1274
1274
 
1275
1275
 
1276
 
class TestWeaveMerge(TestCaseWithTransport, MergeCasesMixin):
 
1276
class TestWeaveMerge(TestCaseWithMemoryTransport, MergeCasesMixin):
1277
1277
 
1278
1278
    def get_file(self, name='foo'):
1279
1279
        return WeaveFile(name, get_transport(self.get_url('.')), create=True)
1286
1286
 
1287
1287
    overlappedInsertExpected = ['aaa', '<<<<<<< ', 'xxx', 'yyy', '=======', 
1288
1288
                                'xxx', '>>>>>>> ', 'bbb']
 
1289
 
 
1290
 
 
1291
class TestFormatSignatures(TestCaseWithMemoryTransport):
 
1292
 
 
1293
    def get_knit_file(self, name, annotated):
 
1294
        if annotated:
 
1295
            factory = KnitAnnotateFactory()
 
1296
        else:
 
1297
            factory = KnitPlainFactory()
 
1298
        return KnitVersionedFile(
 
1299
            name, get_transport(self.get_url('.')), create=True,
 
1300
            factory=factory)
 
1301
 
 
1302
    def test_knit_format_signatures(self):
 
1303
        """Different formats of knit have different signature strings."""
 
1304
        knit = self.get_knit_file('a', True)
 
1305
        self.assertEqual('knit-annotated', knit.get_format_signature())
 
1306
        knit = self.get_knit_file('p', False)
 
1307
        self.assertEqual('knit-plain', knit.get_format_signature())
 
1308