~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_push.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-12-14 18:03:42 UTC
  • mfrom: (4871.4.2 admin-guide-upgrade)
  • Revision ID: pqm@pqm.ubuntu.com-20091214180342-nk22cwvqcz54e331
(nmb) Add upgrade section to admin-guide

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
    workingtree
32
32
    )
33
33
from bzrlib.repofmt import knitrepo
34
 
from bzrlib.tests import (
35
 
    blackbox,
36
 
    http_server,
37
 
    test_foreign,
38
 
    )
 
34
from bzrlib.tests import http_server
39
35
from bzrlib.transport import memory
40
36
 
41
37
 
584
580
 
585
581
class RedirectingMemoryServer(memory.MemoryServer):
586
582
 
587
 
    def start_server(self):
 
583
    def setUp(self):
588
584
        self._dirs = {'/': None}
589
585
        self._files = {}
590
586
        self._locks = {}
598
594
        result._locks = self._locks
599
595
        return result
600
596
 
601
 
    def stop_server(self):
 
597
    def tearDown(self):
602
598
        transport.unregister_transport(self._scheme, self._memory_factory)
603
599
 
604
600
 
772
768
        self.set_config_push_strict('oFF')
773
769
        self.assertPushFails(['--strict'])
774
770
        self.assertPushSucceeds([])
775
 
 
776
 
 
777
 
class TestPushForeign(blackbox.ExternalBase):
778
 
 
779
 
    def setUp(self):
780
 
        super(TestPushForeign, self).setUp()
781
 
        test_foreign.register_dummy_foreign_for_test(self)
782
 
 
783
 
    def make_dummy_builder(self, relpath):
784
 
        builder = self.make_branch_builder(
785
 
            relpath, format=test_foreign.DummyForeignVcsDirFormat())
786
 
        builder.build_snapshot('revid', None,
787
 
            [('add', ('', 'TREE_ROOT', 'directory', None)),
788
 
             ('add', ('foo', 'fooid', 'file', 'bar'))])
789
 
        return builder
790
 
 
791
 
    def test_no_roundtripping(self):
792
 
        target_branch = self.make_dummy_builder('dp').get_branch()
793
 
        source_tree = self.make_branch_and_tree("dc")
794
 
        output, error = self.run_bzr("push -d dc dp", retcode=3)
795
 
        self.assertEquals("", output)
796
 
        self.assertEquals(error, "bzr: ERROR: It is not possible to losslessly"
797
 
            " push to dummy. You may want to use dpush instead.\n")