~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Vincent Ladeuil
  • Date: 2007-07-20 16:57:41 UTC
  • mto: This revision was merged to the branch mainline in revision 2646.
  • Revision ID: v.ladeuil+lp@free.fr-20070720165741-a15p58sjtdm8qd6i
Update from review comments.

* bzrlib/tests/blackbox/test_branch.py:
(TestRemoteBranch): New class ensuring that working trees are not
created remotely.

* bzrlib/transport/sftp.py:
(SFTPTransport.__init__): Make from_transport parameter private.

* bzrlib/transport/remote.py:
(RemoteTransport.__init__): Make from_transport parameter private.
(RemoteHTTPTransport.__init__): Make from_transport parameter private.
(RemoteHTTPTransport.clone): Use _from_transport as a keyword
parameter.

* bzrlib/transport/http/_urllib.py:
(HttpTransport_urllib.__init__): Make from_transport parameter private.

* bzrlib/transport/http/_pycurl.py:
(PyCurlTransport.__init__): Make from_transport parameter private.

* bzrlib/transport/http/__init__.py:
(HttpTransportBase.__init__): Make from_transport parameter private.

* bzrlib/transport/ftp.py:
(FtpTransport.__init__): Make from_transport parameter private.

* bzrlib/transport/__init__.py:
(ConnectedTransport.__init__): Make from_transport parameter private.
(ConnectedTransport.clone, ConnectedTransport._reuse_for): Use
_from_transport as a keyword parameter.

* bzrlib/tests/commands/test_push.py:
(TestPush.test_push): Don't add self.reset_hooks to cleanup,
install_hooks did it.

* bzrlib/tests/commands/test_pull.py:
(TestPull.test_pull): Don't add self.reset_hooks to cleanup,
install_hooks did it.

* bzrlib/tests/commands/test_missing.py:
(TestMissing.test_missing): Don't add self.reset_hooks to cleanup,
install_hooks did it.

* bzrlib/tests/commands/test_merge.py:
(TestMerge.test_merge): Don't add self.reset_hooks to cleanup,
install_hooks did it.

* bzrlib/tests/commands/test_init_repository.py:
(TestInitRepository.setUp): Don't add self.reset_hooks to cleanup,
install_hooks did it.

* bzrlib/tests/commands/test_init.py:
(TestInit.setUp): Don't add self.reset_hooks to cleanup, install_hooks
did it.

* bzrlib/tests/commands/test_checkout.py:
(TestCheckout.test_checkout): Don't add self.reset_hooks to cleanup,
install_hooks did it.

* bzrlib/tests/commands/test_cat.py:
(TestCat.test_cat): Don't add self.reset_hooks to cleanup,
install_hooks did it. Skip the test until sftp transport/server problem
is fixed.

* bzrlib/tests/commands/test_branch.py:
(TestBranch.setUp): Don't add self.reset_hooks to cleanup,
install_hooks did it.

* bzrlib/builtins.py:
(_get_bundle_helper): New function. Factored out from merge and pull.
(cmd_pull.run, cmd_merge.run): Use _get_bundle_helper.
(_merge_helper): Add possible_transports as the last parameter.

* bzrlib/tests/transport_util.py: 
Renamed from bzrlib/tests/TransportUtil.py.  Switch from ftp to sftp
transport and server.

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
from bzrlib import branch, bzrdir
23
23
from bzrlib.repofmt.knitrepo import RepositoryFormatKnit1
24
24
from bzrlib.tests.blackbox import ExternalBase
 
25
from bzrlib.tests.test_sftp_transport import TestCaseWithSFTPServer
25
26
from bzrlib.workingtree import WorkingTree
26
27
 
27
28
 
89
90
        self.assertTrue(pushed_repo.has_revision('b-1'))
90
91
 
91
92
 
 
93
class TestRemoteBranch(TestCaseWithSFTPServer):
 
94
 
 
95
    def setUp(self):
 
96
        super(TestRemoteBranch, self).setUp()
 
97
        tree = self.make_branch_and_tree('branch')
 
98
        self.build_tree_contents([('branch/file', 'file content\n')])
 
99
        tree.add('file')
 
100
        tree.commit('file created')
 
101
 
 
102
    def test_branch_local_remote(self):
 
103
        self.run_bzr(['branch', 'branch', self.get_url('remote')])
 
104
        t = self.get_transport()
 
105
        # Ensures that no working tree what created remotely
 
106
        self.assertFalse(t.has('remote/file'))
 
107
 
 
108
    def test_branch_remote_remote(self):
 
109
        # Light cheat: we access the branch remotely
 
110
        self.run_bzr(['branch', self.get_url('branch'),
 
111
                      self.get_url('remote')])
 
112
        t = self.get_transport()
 
113
        # Ensures that no working tree what created remotely
 
114
        self.assertFalse(t.has('remote/file'))
 
115