~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Andrew Bennetts
  • Date: 2010-01-15 03:58:20 UTC
  • mfrom: (4963 +trunk)
  • mto: (4973.1.1 integration)
  • mto: This revision was merged to the branch mainline in revision 4975.
  • Revision ID: andrew.bennetts@canonical.com-20100115035820-ilb3t36swgzq6v1l
MergeĀ lp:bzr.

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 http_server
 
34
from bzrlib.tests import (
 
35
    blackbox,
 
36
    http_server,
 
37
    test_foreign,
 
38
    )
35
39
from bzrlib.transport import memory
36
40
 
37
41
 
580
584
 
581
585
class RedirectingMemoryServer(memory.MemoryServer):
582
586
 
583
 
    def setUp(self):
 
587
    def start_server(self):
584
588
        self._dirs = {'/': None}
585
589
        self._files = {}
586
590
        self._locks = {}
594
598
        result._locks = self._locks
595
599
        return result
596
600
 
597
 
    def tearDown(self):
 
601
    def stop_server(self):
598
602
        transport.unregister_transport(self._scheme, self._memory_factory)
599
603
 
600
604
 
768
772
        self.set_config_push_strict('oFF')
769
773
        self.assertPushFails(['--strict'])
770
774
        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")