~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Vincent Ladeuil
  • Date: 2007-06-03 15:52:19 UTC
  • mto: (2485.8.44 bzr.connection.sharing)
  • mto: This revision was merged to the branch mainline in revision 2646.
  • Revision ID: v.ladeuil+lp@free.fr-20070603155219-f7dtbnwdqrhs0kpk
Refactor mutiple connections detection and fix false positives. Only
merge and pull are still bougs.

* bzrlib/tests/commands/test_push.py:
(TestPush.test_push): Reset connections after branch and tree
creation.

* bzrlib/tests/commands/test_missing.py:
(TestMissing.test_missing): Reset connections after branch and tree
creation.

* bzrlib/tests/commands/test_merge.py:
(TestMerge.test_merge): Reset connections after branch and tree
creation.

* bzrlib/tests/commands/test_checkout.py:
(TestCheckout.test_checkout): Reset connections after branch and tree
creation.

* bzrlib/tests/commands/test_cat.py:
(TestCat.test_cat): Reset connections after branch and tree
creation.

* bzrlib/tests/commands/test_branch.py:
(TestBranch.setUp): Reset connections after branch and tree
creation.

* bzrlib/tests/TransportUtil.py:
(TransportHooks.__init__): Use _set_connection instead of
_get_FTP.
(ConnectionHookedTransport): Replace _get_FTP by _set_connection.
(TestCaseWithConnectionHookedTransport.setUp): Replace _get_FTP by
_set_connection.
(TestCaseWithConnectionHookedTransport.reset_connections): New
method.
(TestCaseWithConnectionHookedTransport.set_connection_hook):
Replace get_connection_hook.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
 
22
22
class TestBranch(TestCaseWithConnectionHookedTransport):
23
23
 
 
24
    def setUp(self):
 
25
        super(TestBranch, self).setUp()
 
26
        self.make_branch_and_tree('branch')
 
27
        # make_branch_and_tree create one connection
 
28
        self.reset_connections()
 
29
 
24
30
    def test_branch_remote_local(self):
25
 
        self.make_branch_and_tree('branch')
26
31
        cmd = cmd_branch()
27
32
        cmd.run(self.get_url() + '/branch', 'local')
28
33
        self.assertEquals(1, len(self.connections))
29
34
 
30
35
    # This is bug 112173
31
36
    def test_branch_local_remote(self):
32
 
        self.make_branch_and_tree('branch')
33
37
        cmd = cmd_branch()
34
38
        cmd.run('branch', self.get_url() + '/remote')
35
39
        self.assertEquals(1, len(self.connections))
36
40
 
37
41
    # This is bug 112173 too
38
42
    def test_branch_remote_remote(self):
39
 
        self.make_branch_and_tree('branch')
40
43
        cmd = cmd_branch()
41
44
        cmd.run(self.get_url() + '/branch', self.get_url() + '/remote')
42
45
        self.assertEquals(2, len(self.connections))