~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_versionedfile.py

  • Committer: Andrew Bennetts
  • Date: 2007-08-30 08:27:29 UTC
  • mto: (2535.3.55 repo-refactor)
  • mto: This revision was merged to the branch mainline in revision 2772.
  • Revision ID: andrew.bennetts@canonical.com-20070830082729-8bue7wh0bqut2xs2
Remove get_stream_as_bytes from KnitVersionedFile's API, make it a function in knitrepo.py instead.

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
                           RevisionAlreadyPresent,
35
35
                           WeaveParentMismatch
36
36
                           )
37
 
from bzrlib.knit import (
38
 
    KnitVersionedFile,
39
 
    KnitAnnotateFactory,
40
 
    KnitPlainFactory,
41
 
    )
 
37
from bzrlib.knit import KnitVersionedFile, \
 
38
     KnitAnnotateFactory, KnitPlainFactory
42
39
from bzrlib.tests import TestCaseWithMemoryTransport, TestSkipped
43
40
from bzrlib.tests.HTTPTestUtil import TestCaseWithWebserver
44
41
from bzrlib.trace import mutter
884
881
class TestKnit(TestCaseWithMemoryTransport, VersionedFileTestMixIn):
885
882
 
886
883
    def get_file(self, name='foo'):
887
 
        return self.get_factory()(name, get_transport(self.get_url('.')),
888
 
                                  delta=True, create=True)
 
884
        return KnitVersionedFile(name, get_transport(self.get_url('.')),
 
885
                                 delta=True, create=True)
889
886
 
890
887
    def get_factory(self):
891
888
        return KnitVersionedFile
897
894
        return knit
898
895
 
899
896
    def reopen_file(self, name='foo', create=False):
900
 
        return self.get_factory()(name, get_transport(self.get_url('.')),
 
897
        return KnitVersionedFile(name, get_transport(self.get_url('.')),
901
898
            delta=True,
902
899
            create=create)
903
900
 
912
909
                          get_transport(self.get_url('.')))
913
910
 
914
911
 
915
 
class TestPlaintextKnit(TestKnit):
916
 
    """Test a knit with no cached annotations"""
917
 
 
918
 
    def _factory(self, name, transport, file_mode=None, access_mode=None,
919
 
                 delta=True, create=False):
920
 
        return KnitVersionedFile(name, transport, file_mode, access_mode,
921
 
                                 KnitPlainFactory(), delta=delta,
922
 
                                 create=create)
923
 
 
924
 
    def get_factory(self):
925
 
        return self._factory
926
 
 
927
 
 
928
912
class InterString(versionedfile.InterVersionedFile):
929
913
    """An inter-versionedfile optimised code path for strings.
930
914