/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 bzrlib/tests/blackbox/test_help.py

  • Committer: Richard Wilbur
  • Date: 2016-02-04 19:07:28 UTC
  • mto: This revision was merged to the branch mainline in revision 6618.
  • Revision ID: richard.wilbur@gmail.com-20160204190728-p0zvfii6zase0fw7
Update COPYING.txt from the original http://www.gnu.org/licenses/gpl-2.0.txt  (Only differences were in whitespace.)  Thanks to Petr Stodulka for pointing out the discrepancy.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2006, 2007, 2009-2012, 2016 Canonical Ltd
 
1
# Copyright (C) 2006, 2007, 2009, 2010, 2011 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
15
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
17
 
18
 
"""Black-box tests for brz help.
 
18
"""Black-box tests for bzr help.
19
19
"""
20
20
 
21
21
 
22
 
from breezy import (
 
22
from bzrlib import (
23
23
    config,
24
24
    i18n,
25
25
    tests,
26
26
    )
27
27
 
28
 
from breezy.tests.test_i18n import ZzzTranslations
 
28
from bzrlib.tests.test_i18n import ZzzTranslations
29
29
 
30
30
 
31
31
class TestHelp(tests.TestCaseWithTransport):
34
34
        for cmd in ['--help', 'help', '-h', '-?']:
35
35
            output = self.run_bzr(cmd)[0]
36
36
            line1 = output.split('\n')[0]
37
 
            if not line1.startswith('Breezy'):
38
 
                self.fail("bad output from brz %s:\n%r" % (cmd, output))
 
37
            if not line1.startswith('Bazaar'):
 
38
                self.fail("bad output from bzr %s:\n%r" % (cmd, output))
39
39
        # see https://launchpad.net/products/bzr/+bug/35940, -h doesn't work
40
40
 
41
41
    def test_help_topics(self):
42
 
        """Smoketest for 'brz help topics'"""
 
42
        """Smoketest for 'bzr help topics'"""
43
43
        out, err = self.run_bzr('help topics')
44
44
        self.assertContainsRe(out, 'basic')
45
45
        self.assertContainsRe(out, 'topics')
47
47
        self.assertContainsRe(out, 'revisionspec')
48
48
 
49
49
    def test_help_revisionspec(self):
50
 
        """Smoke test for 'brz help revisionspec'"""
 
50
        """Smoke test for 'bzr help revisionspec'"""
51
51
        out, err = self.run_bzr('help revisionspec')
52
52
        self.assertContainsRe(out, 'revno:')
53
53
        self.assertContainsRe(out, 'date:')
58
58
        self.assertContainsRe(out, 'branch:')
59
59
 
60
60
    def test_help_checkouts(self):
61
 
        """Smoke test for 'brz help checkouts'"""
 
61
        """Smoke test for 'bzr help checkouts'"""
62
62
        out, err = self.run_bzr('help checkouts')
63
63
        self.assertContainsRe(out, 'checkout')
64
64
        self.assertContainsRe(out, 'lightweight')
65
65
 
66
66
    def test_help_urlspec(self):
67
 
        """Smoke test for 'brz help urlspec'"""
 
67
        """Smoke test for 'bzr help urlspec'"""
68
68
        out, err = self.run_bzr('help urlspec')
69
69
        self.assertContainsRe(out, 'aftp://')
70
70
        self.assertContainsRe(out, 'bzr://')
76
76
        self.assertContainsRe(out, 'sftp://')
77
77
 
78
78
    def test_help_repositories(self):
79
 
        """Smoke test for 'brz help repositories'"""
 
79
        """Smoke test for 'bzr help repositories'"""
80
80
        out, err = self.run_bzr('help repositories')
81
 
        from breezy.help_topics import help_as_plain_text, _repositories
 
81
        from bzrlib.help_topics import help_as_plain_text, _repositories
82
82
        expected = help_as_plain_text(_repositories)
83
83
        self.assertEqual(expected, out)
84
84
 
85
85
    def test_help_working_trees(self):
86
 
        """Smoke test for 'brz help working-trees'"""
 
86
        """Smoke test for 'bzr help working-trees'"""
87
87
        out, err = self.run_bzr('help working-trees')
88
 
        from breezy.help_topics import help_as_plain_text, _working_trees
 
88
        from bzrlib.help_topics import help_as_plain_text, _working_trees
89
89
        expected = help_as_plain_text(_working_trees)
90
90
        self.assertEqual(expected, out)
91
91
 
92
92
    def test_help_status_flags(self):
93
 
        """Smoke test for 'brz help status-flags'"""
 
93
        """Smoke test for 'bzr help status-flags'"""
94
94
        out, err = self.run_bzr('help status-flags')
95
 
        from breezy.help_topics import help_as_plain_text, _status_flags
 
95
        from bzrlib.help_topics import help_as_plain_text, _status_flags
96
96
        expected = help_as_plain_text(_status_flags)
97
97
        self.assertEqual(expected, out)
98
98
 
103
103
        long_help  = self.run_bzr('help --long')[0]
104
104
        qmark_long = self.run_bzr('? --long')[0]
105
105
        qmark_cmds = self.run_bzr('? commands')[0]
106
 
        self.assertEqual(dash_help, commands)
107
 
        self.assertEqual(dash_help, long_help)
108
 
        self.assertEqual(dash_help, qmark_long)
109
 
        self.assertEqual(dash_help, qmark_cmds)
 
106
        self.assertEquals(dash_help, commands)
 
107
        self.assertEquals(dash_help, long_help)
 
108
        self.assertEquals(dash_help, qmark_long)
 
109
        self.assertEquals(dash_help, qmark_cmds)
110
110
 
111
111
    def test_help_width_zero(self):
112
 
        self.overrideEnv('BRZ_COLUMNS', '0')
 
112
        self.overrideEnv('BZR_COLUMNS', '0')
113
113
        self.run_bzr('help commands')
114
114
 
115
115
    def test_hidden(self):
138
138
    def test_help_detail(self):
139
139
        dash_h  = self.run_bzr('diff -h')[0]
140
140
        help_x  = self.run_bzr('help diff')[0]
141
 
        self.assertEqual(dash_h, help_x)
 
141
        self.assertEquals(dash_h, help_x)
142
142
        self.assertContainsRe(help_x, "Purpose:")
143
143
        self.assertContainsRe(help_x, "Usage:")
144
144
        self.assertContainsRe(help_x, "Options:")
160
160
    def test_help_help(self):
161
161
        help = self.run_bzr('help help')[0]
162
162
        qmark = self.run_bzr('? ?')[0]
163
 
        self.assertEqual(help, qmark)
 
163
        self.assertEquals(help, qmark)
164
164
        for line in help.split('\n'):
165
165
            if '--long' in line:
166
166
                self.assertContainsRe(line,
174
174
cat=cat
175
175
''', save=True)
176
176
 
177
 
        expected = original + "'brz cat' is an alias for 'brz cat'.\n"
 
177
        expected = original + "'bzr cat' is an alias for 'bzr cat'.\n"
178
178
        self.assertEqual(expected, self.run_bzr('help cat')[0])
179
179
 
180
 
        self.assertEqual("'brz c' is an alias for 'brz cat'.\n",
 
180
        self.assertEqual("'bzr c' is an alias for 'bzr cat'.\n",
181
181
                         self.run_bzr('help c')[0])
182
182
 
183
183