/breezy/unstable

To get this branch, use:
bzr branch https://code.breezy-vcs.org/breezy/unstable

« back to all changes in this revision

Viewing changes to breezy/tests/blackbox/test_help.py

  • Committer: Jelmer Vernooij
  • Date: 2017-05-24 01:39:33 UTC
  • mfrom: (3815.3776.6)
  • Revision ID: jelmer@jelmer.uk-20170524013933-ir4y4tqtrsiz2ka2
New upstream snapshot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
17
 
18
 
"""Black-box tests for bzr help.
 
18
"""Black-box tests for brz help.
19
19
"""
20
20
 
21
21
 
22
 
from bzrlib import (
 
22
from breezy import (
23
23
    config,
24
24
    i18n,
25
25
    tests,
26
26
    )
27
27
 
28
 
from bzrlib.tests.test_i18n import ZzzTranslations
 
28
from breezy.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('Bazaar'):
38
 
                self.fail("bad output from bzr %s:\n%r" % (cmd, output))
 
37
            if not line1.startswith('Breezy'):
 
38
                self.fail("bad output from brz %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 'bzr help topics'"""
 
42
        """Smoketest for 'brz 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 'bzr help revisionspec'"""
 
50
        """Smoke test for 'brz 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 'bzr help checkouts'"""
 
61
        """Smoke test for 'brz 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 'bzr help urlspec'"""
 
67
        """Smoke test for 'brz 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 'bzr help repositories'"""
 
79
        """Smoke test for 'brz help repositories'"""
80
80
        out, err = self.run_bzr('help repositories')
81
 
        from bzrlib.help_topics import help_as_plain_text, _repositories
 
81
        from breezy.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 'bzr help working-trees'"""
 
86
        """Smoke test for 'brz help working-trees'"""
87
87
        out, err = self.run_bzr('help working-trees')
88
 
        from bzrlib.help_topics import help_as_plain_text, _working_trees
 
88
        from breezy.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 'bzr help status-flags'"""
 
93
        """Smoke test for 'brz help status-flags'"""
94
94
        out, err = self.run_bzr('help status-flags')
95
 
        from bzrlib.help_topics import help_as_plain_text, _status_flags
 
95
        from breezy.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
 
109
109
        self.assertEqual(dash_help, qmark_cmds)
110
110
 
111
111
    def test_help_width_zero(self):
112
 
        self.overrideEnv('BZR_COLUMNS', '0')
 
112
        self.overrideEnv('BRZ_COLUMNS', '0')
113
113
        self.run_bzr('help commands')
114
114
 
115
115
    def test_hidden(self):
174
174
cat=cat
175
175
''', save=True)
176
176
 
177
 
        expected = original + "'bzr cat' is an alias for 'bzr cat'.\n"
 
177
        expected = original + "'brz cat' is an alias for 'brz cat'.\n"
178
178
        self.assertEqual(expected, self.run_bzr('help cat')[0])
179
179
 
180
 
        self.assertEqual("'bzr c' is an alias for 'bzr cat'.\n",
 
180
        self.assertEqual("'brz c' is an alias for 'brz cat'.\n",
181
181
                         self.run_bzr('help c')[0])
182
182
 
183
183