/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar
6162.4.10 by Jonathan Riddell
add random meaningless characters as required by testsuite
1
# Copyright (C) 2011 Canonical Ltd
6162.4.6 by Jonathan Riddell
add blackbox test for export_pot
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
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
17
6622.1.29 by Jelmer Vernooij
Fix some more tests.
18
"""External tests of 'brz export-pot'"""
6162.4.6 by Jonathan Riddell
add blackbox test for export_pot
19
import os
20
6622.1.34 by Jelmer Vernooij
Rename brzlib => breezy.
21
from breezy import ignores, osutils
22
from breezy.tests import TestCaseWithMemoryTransport
6703.1.3 by Jelmer Vernooij
Use features for test_export_pot.
23
from breezy.tests.features import PluginLoadedFeature
6162.4.6 by Jonathan Riddell
add blackbox test for export_pot
24
7143.15.2 by Jelmer Vernooij
Run autopep8.
25
6162.4.6 by Jonathan Riddell
add blackbox test for export_pot
26
class TestExportPot(TestCaseWithMemoryTransport):
27
28
    def test_export_pot(self):
29
        out, err = self.run_bzr("export-pot")
7143.15.2 by Jelmer Vernooij
Run autopep8.
30
        self.assertContainsRe(
31
            err, 'Exporting messages from builtin command: add')
32
        self.assertContainsRe(out, "help of 'change' option\n"
7027.4.1 by Jelmer Vernooij
Use StringIOWithEncoding on Python3.
33
                                   "msgid \"Select changes introduced by the specified revision.")
6162.4.6 by Jonathan Riddell
add blackbox test for export_pot
34
6703.1.4 by Jelmer Vernooij
Print an error when trying to export pot file from a plugin that doesn't exist.
35
    def test_export_pot_plugin_unknown(self):
36
        out, err = self.run_bzr("export-pot --plugin=lalalala", retcode=3)
37
        self.assertContainsRe(
7143.15.2 by Jelmer Vernooij
Run autopep8.
38
            err, 'ERROR: Plugin lalalala is not loaded')
6703.1.4 by Jelmer Vernooij
Print an error when trying to export pot file from a plugin that doesn't exist.
39
6162.4.6 by Jonathan Riddell
add blackbox test for export_pot
40
    def test_export_pot_plugin(self):
6703.1.3 by Jelmer Vernooij
Use features for test_export_pot.
41
        self.requireFeature(PluginLoadedFeature('launchpad'))
6177.1.2 by Jonathan Riddell
simplify checking for bzrlib.plugins.launchpad
42
        out, err = self.run_bzr("export-pot --plugin=launchpad")
7143.15.2 by Jelmer Vernooij
Run autopep8.
43
        self.assertContainsRe(
44
            err, 'Exporting messages from plugin command: launchpad-login in launchpad')
45
        self.assertContainsRe(
46
            out, 'msgid "Show or set the Launchpad user ID."')