/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/tests/commands/test_push.py

  • Committer: Jelmer Vernooij
  • Date: 2020-04-05 19:11:34 UTC
  • mto: (7490.7.16 work)
  • mto: This revision was merged to the branch mainline in revision 7501.
  • Revision ID: jelmer@jelmer.uk-20200405191134-0aebh8ikiwygxma5
Populate the .gitignore file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2007-2010 Canonical Ltd
 
1
# Copyright (C) 2007-2010, 2016 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
 
 
18
 
from bzrlib import tests
19
 
from bzrlib.builtins import cmd_push
20
 
from bzrlib.tests.transport_util import TestCaseWithConnectionHookedTransport
21
 
 
22
 
 
23
 
class TestPush(TestCaseWithConnectionHookedTransport):
 
17
from ...builtins import cmd_push
 
18
from .. import (
 
19
    transport_util,
 
20
    ui_testing,
 
21
    )
 
22
 
 
23
 
 
24
class TestPush(transport_util.TestCaseWithConnectionHookedTransport):
24
25
 
25
26
    def test_push(self):
26
27
        self.make_branch_and_tree('branch')
29
30
 
30
31
        cmd = cmd_push()
31
32
        # We don't care about the ouput but 'outf' should be defined
32
 
        cmd.outf = tests.StringIOWrapper()
 
33
        cmd.outf = ui_testing.StringIOWithEncoding()
33
34
        cmd.run(self.get_url('remote'), directory='branch')
34
 
        self.assertEquals(1, len(self.connections))
 
35
        self.assertEqual(1, len(self.connections))
35
36
 
36
37
    def test_push_onto_stacked(self):
37
38
        self.make_branch_and_tree('base', format='1.9')
40
41
        self.start_logging_connections()
41
42
 
42
43
        cmd = cmd_push()
43
 
        cmd.outf = tests.StringIOWrapper()
 
44
        cmd.outf = ui_testing.StringIOWithEncoding()
44
45
        cmd.run(self.get_url('remote'), directory='source',
45
46
                stacked_on=self.get_url('base'))
46
47
        self.assertEqual(1, len(self.connections))