~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/per_pack_repository.py

  • Committer: Vincent Ladeuil
  • Date: 2010-02-11 09:21:45 UTC
  • mto: (5029.1.1 integration)
  • mto: This revision was merged to the branch mainline in revision 5030.
  • Revision ID: v.ladeuil+lp@free.fr-20100211092145-drh33z43szccfswy
Move MemoryServer back into bzrlib.transport.memory as it's needed as soon as a MemoryTransport is used. Add a NEWS entry.

Show diffs side-by-side

added added

removed removed

Lines of Context:
54
54
    )
55
55
from bzrlib.transport import (
56
56
    get_transport,
 
57
    memory,
57
58
    )
58
59
from bzrlib.tests import test_server
59
60
from bzrlib.tests.per_repository import TestCaseWithRepository
238
239
 
239
240
    def test_commit_write_group_returns_new_pack_names(self):
240
241
        # This test doesn't need real disk.
241
 
        self.vfs_transport_factory = test_server.MemoryServer
 
242
        self.vfs_transport_factory = memory.MemoryServer
242
243
        format = self.get_format()
243
244
        repo = self.make_repository('foo', format=format)
244
245
        repo.lock_write()
707
708
 
708
709
        Also requires that the exception is logged.
709
710
        """
710
 
        self.vfs_transport_factory = test_server.MemoryServer
 
711
        self.vfs_transport_factory = memory.MemoryServer
711
712
        repo = self.make_repository('repo', format=self.get_format())
712
713
        token = repo.lock_write()
713
714
        self.addCleanup(repo.unlock)
724
725
            repo.leave_lock_in_place()
725
726
 
726
727
    def test_abort_write_group_does_raise_when_not_suppressed(self):
727
 
        self.vfs_transport_factory = test_server.MemoryServer
 
728
        self.vfs_transport_factory = memory.MemoryServer
728
729
        repo = self.make_repository('repo', format=self.get_format())
729
730
        token = repo.lock_write()
730
731
        self.addCleanup(repo.unlock)
737
738
            repo.leave_lock_in_place()
738
739
 
739
740
    def test_suspend_write_group(self):
740
 
        self.vfs_transport_factory = test_server.MemoryServer
 
741
        self.vfs_transport_factory = memory.MemoryServer
741
742
        repo = self.make_repository('repo', format=self.get_format())
742
743
        token = repo.lock_write()
743
744
        self.addCleanup(repo.unlock)
757
758
        self.assertEqual(wg_tokens[0], md5.hexdigest())
758
759
 
759
760
    def test_resume_chk_bytes(self):
760
 
        self.vfs_transport_factory = test_server.MemoryServer
 
761
        self.vfs_transport_factory = memory.MemoryServer
761
762
        repo = self.make_repository('repo', format=self.get_format())
762
763
        if repo.chk_bytes is None:
763
764
            raise TestNotApplicable('no chk_bytes for this repository')
781
782
 
782
783
    def test_resume_write_group_then_abort(self):
783
784
        # Create a repo, start a write group, insert some data, suspend.
784
 
        self.vfs_transport_factory = test_server.MemoryServer
 
785
        self.vfs_transport_factory = memory.MemoryServer
785
786
        repo = self.make_repository('repo', format=self.get_format())
786
787
        token = repo.lock_write()
787
788
        self.addCleanup(repo.unlock)
802
803
            [], same_repo._pack_collection._pack_transport.list_dir(''))
803
804
 
804
805
    def test_commit_resumed_write_group(self):
805
 
        self.vfs_transport_factory = test_server.MemoryServer
 
806
        self.vfs_transport_factory = memory.MemoryServer
806
807
        repo = self.make_repository('repo', format=self.get_format())
807
808
        token = repo.lock_write()
808
809
        self.addCleanup(repo.unlock)
830
831
        self.assertEqual([expected_pack_name], pack_names)
831
832
 
832
833
    def test_resume_malformed_token(self):
833
 
        self.vfs_transport_factory = test_server.MemoryServer
 
834
        self.vfs_transport_factory = memory.MemoryServer
834
835
        # Make a repository with a suspended write group
835
836
        repo = self.make_repository('repo', format=self.get_format())
836
837
        token = repo.lock_write()