~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_versionedfile.py

  • Committer: Robert Collins
  • Date: 2006-03-02 07:43:46 UTC
  • mto: (1594.2.4 integration)
  • mto: This revision was merged to the branch mainline in revision 1596.
  • Revision ID: robertc@robertcollins.net-20060302074346-f6ea05e3f19f6b8b
Change WeaveStore into VersionedFileStore and make its versoined file class parameterisable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
     KnitAnnotateFactory
30
30
from bzrlib.tests import TestCaseWithTransport
31
31
from bzrlib.trace import mutter
32
 
from bzrlib.transport.local import LocalTransport
 
32
from bzrlib.transport import get_transport
33
33
from bzrlib.transport.memory import MemoryTransport
34
34
import bzrlib.versionedfile as versionedfile
35
35
from bzrlib.weave import WeaveFile
209
209
class TestWeave(TestCaseWithTransport, VersionedFileTestMixIn):
210
210
 
211
211
    def get_file(self, name='foo'):
212
 
        return WeaveFile(name, LocalTransport('.'))
 
212
        return WeaveFile(name, get_transport(self.get_url('.')))
213
213
 
214
214
    def get_file_corrupted_text(self):
215
 
        w = WeaveFile('foo', LocalTransport('.'))
 
215
        w = WeaveFile('foo', get_transport(self.get_url('.')))
216
216
        w.add_lines('v1', [], ['hello\n'])
217
217
        w.add_lines('v2', ['v1'], ['hello\n', 'there\n'])
218
218
        
246
246
        return w
247
247
 
248
248
    def reopen_file(self, name='foo'):
249
 
        return WeaveFile(name, LocalTransport('.'))
 
249
        return WeaveFile(name, get_transport(self.get_url('.')))
250
250
 
251
251
 
252
252
class TestKnit(TestCaseWithTransport, VersionedFileTestMixIn):
253
253
 
254
254
    def get_file(self, name='foo'):
255
 
        return KnitVersionedFile(LocalTransport('.'),
256
 
            name, 'w', KnitAnnotateFactory(), delta=True)
 
255
        return KnitVersionedFile(name, get_transport(self.get_url('.')),
 
256
                                 delta=True)
257
257
 
258
258
    def get_file_corrupted_text(self):
259
259
        knit = self.get_file()
262
262
        return knit
263
263
 
264
264
    def reopen_file(self, name='foo'):
265
 
        return KnitVersionedFile(LocalTransport('.'),
266
 
            name, 'w', KnitAnnotateFactory(), delta=True)
 
265
        return KnitVersionedFile(name, get_transport(self.get_url('.')), delta=True)
267
266
 
268
267
    def test_detection(self):
269
268
        print "TODO for merging: create a corrupted knit."