/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/cmd_test_script.py

  • Committer: INADA Naoki
  • Date: 2011-05-05 09:15:34 UTC
  • mto: (5830.3.3 i18n-msgfmt)
  • mto: This revision was merged to the branch mainline in revision 5873.
  • Revision ID: songofacandy@gmail.com-20110505091534-7sv835xpofwrmpt4
Add update-pot command to Makefile and tools/bzrgettext script that
extracts help text from bzr commands.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
This module should be importable even if testtools aren't available.
21
21
"""
22
22
 
23
 
from __future__ import absolute_import
24
 
 
25
23
import os
26
24
 
27
 
from . import (
 
25
from bzrlib import (
28
26
    commands,
29
27
    option,
30
28
    )
37
35
    takes_args = ['infile']
38
36
    takes_options = [
39
37
        option.Option('null-output',
40
 
                      help='Null command outputs match any output.'),
 
38
                       help='Null command outputs match any output.'),
41
39
        ]
42
40
 
43
41
    @commands.display_command
44
42
    def run(self, infile, null_output=False):
45
43
        # local imports to defer testtools dependency
46
 
        from breezy import tests
47
 
        from breezy.tests.script import TestCaseWithTransportAndScript
 
44
        from bzrlib import tests
 
45
        from bzrlib.tests.script import TestCaseWithTransportAndScript
48
46
 
49
 
        with open(infile) as f:
 
47
        f = open(infile)
 
48
        try:
50
49
            script = f.read()
 
50
        finally:
 
51
            f.close()
51
52
 
52
53
        class Test(TestCaseWithTransportAndScript):
53
54
 
54
 
            script = None  # Set before running
 
55
            script = None # Set before running
55
56
 
56
57
            def test_it(self):
57
58
                self.run_script(script,