bzr branch
http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar
|
6614.1.3
by Vincent Ladeuil
Fix assertEquals being deprecated by using assertEqual. |
1 |
# Copyright (C) 2007, 2009, 2010, 2011, 2016 Canonical Ltd
|
|
2485.8.7
by Vincent Ladeuil
Add test for pull. |
2 |
#
|
3 |
# This program is free software; you can redistribute it and/or modify
|
|
4 |
# it under the terms of the GNU General Public License as published by
|
|
5 |
# the Free Software Foundation; either version 2 of the License, or
|
|
6 |
# (at your option) any later version.
|
|
7 |
#
|
|
8 |
# This program is distributed in the hope that it will be useful,
|
|
9 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
10 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
11 |
# GNU General Public License for more details.
|
|
12 |
#
|
|
13 |
# You should have received a copy of the GNU General Public License
|
|
14 |
# along with this program; if not, write to the Free Software
|
|
|
4183.7.1
by Sabin Iacob
update FSF mailing address |
15 |
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
2485.8.7
by Vincent Ladeuil
Add test for pull. |
16 |
|
|
6624
by Jelmer Vernooij
Merge Python3 porting work ('py3 pokes') |
17 |
from ... import ( |
|
2817.4.3
by Vincent Ladeuil
Add tests for commit, reuse master branch transport. |
18 |
branch, |
19 |
builtins, |
|
|
6621.22.2
by Martin
Use BytesIO or StringIO from bzrlib.sixish |
20 |
)
|
|
6624
by Jelmer Vernooij
Merge Python3 porting work ('py3 pokes') |
21 |
from .. import ( |
|
6621.22.2
by Martin
Use BytesIO or StringIO from bzrlib.sixish |
22 |
transport_util, |
23 |
ui_testing, |
|
24 |
)
|
|
|
2817.4.3
by Vincent Ladeuil
Add tests for commit, reuse master branch transport. |
25 |
|
26 |
||
27 |
class TestPull(transport_util.TestCaseWithConnectionHookedTransport): |
|
|
2485.8.7
by Vincent Ladeuil
Add test for pull. |
28 |
|
29 |
def test_pull(self): |
|
30 |
wt1 = self.make_branch_and_tree('branch1') |
|
31 |
tip = wt1.commit('empty commit') |
|
32 |
wt2 = self.make_branch_and_tree('branch2') |
|
|
2485.8.36
by Vincent Ladeuil
Fix test suite to provide a better debugging experience. |
33 |
|
|
2814.11.1
by Vincent Ladeuil
Renamed install_hooks to start_logging_connections (as per Martin suggestion). |
34 |
self.start_logging_connections() |
|
2485.8.7
by Vincent Ladeuil
Add test for pull. |
35 |
|
|
2817.4.3
by Vincent Ladeuil
Add tests for commit, reuse master branch transport. |
36 |
cmd = builtins.cmd_pull() |
|
2485.8.7
by Vincent Ladeuil
Add test for pull. |
37 |
# We don't care about the ouput but 'outf' should be defined
|
|
6621.22.2
by Martin
Use BytesIO or StringIO from bzrlib.sixish |
38 |
cmd.outf = ui_testing.StringIOWithEncoding() |
|
5141.2.1
by Robert Collins
``bzrlib.commands.Command.run_direct`` is no longer needed - the pre |
39 |
cmd.run(self.get_url('branch1'), directory='branch2') |
|
6614.1.3
by Vincent Ladeuil
Fix assertEquals being deprecated by using assertEqual. |
40 |
self.assertEqual(1, len(self.connections)) |
|
2485.8.7
by Vincent Ladeuil
Add test for pull. |
41 |
|
|
2817.4.3
by Vincent Ladeuil
Add tests for commit, reuse master branch transport. |
42 |
def test_pull_with_bound_branch(self): |
43 |
||
44 |
master_wt = self.make_branch_and_tree('master') |
|
45 |
local_wt = self.make_branch_and_tree('local') |
|
46 |
master_branch = branch.Branch.open(self.get_url('master')) |
|
47 |
local_wt.branch.bind(master_branch) |
|
48 |
||
49 |
remote_wt = self.make_branch_and_tree('remote') |
|
50 |
remote_wt.commit('empty commit') |
|
51 |
||
52 |
self.start_logging_connections() |
|
53 |
||
54 |
pull = builtins.cmd_pull() |
|
55 |
# We don't care about the ouput but 'outf' should be defined
|
|
|
6621.22.2
by Martin
Use BytesIO or StringIO from bzrlib.sixish |
56 |
pull.outf = ui_testing.StringIOWithEncoding() |
|
5141.2.1
by Robert Collins
``bzrlib.commands.Command.run_direct`` is no longer needed - the pre |
57 |
pull.run(self.get_url('remote'), directory='local') |
|
6614.1.3
by Vincent Ladeuil
Fix assertEquals being deprecated by using assertEqual. |
58 |
self.assertEqual(2, len(self.connections)) |