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

  • Committer: Jelmer Vernooij
  • Date: 2017-05-21 12:41:27 UTC
  • mto: This revision was merged to the branch mainline in revision 6623.
  • Revision ID: jelmer@jelmer.uk-20170521124127-iv8etg0vwymyai6y
s/bzr/brz/ in apport config.

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
 
23
25
import os
24
26
 
25
 
from . import (
 
27
from brzlib import (
26
28
    commands,
27
29
    option,
28
30
    )
35
37
    takes_args = ['infile']
36
38
    takes_options = [
37
39
        option.Option('null-output',
38
 
                      help='Null command outputs match any output.'),
 
40
                       help='Null command outputs match any output.'),
39
41
        ]
40
42
 
41
43
    @commands.display_command
42
44
    def run(self, infile, null_output=False):
43
45
        # local imports to defer testtools dependency
44
 
        from breezy import tests
45
 
        from breezy.tests.script import TestCaseWithTransportAndScript
 
46
        from brzlib import tests
 
47
        from brzlib.tests.script import TestCaseWithTransportAndScript
46
48
 
47
 
        with open(infile) as f:
 
49
        f = open(infile)
 
50
        try:
48
51
            script = f.read()
 
52
        finally:
 
53
            f.close()
49
54
 
50
55
        class Test(TestCaseWithTransportAndScript):
51
56
 
52
 
            script = None  # Set before running
 
57
            script = None # Set before running
53
58
 
54
59
            def test_it(self):
55
60
                self.run_script(script,