~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/plugins/bash_completion/tests/test_bashcomp.py

  • Committer: Andrew Bennetts
  • Date: 2010-10-08 08:15:14 UTC
  • mto: This revision was merged to the branch mainline in revision 5498.
  • Revision ID: andrew.bennetts@canonical.com-20101008081514-dviqzrdfwyzsqbz2
Split NEWS into per-release doc/en/release-notes/bzr-*.txt

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
 
import sys
18
 
 
19
17
import bzrlib
20
18
from bzrlib import commands, tests
21
19
from bzrlib.tests import features
22
20
from bzrlib.plugins.bash_completion.bashcomp import *
23
21
 
 
22
import os
24
23
import subprocess
25
24
 
26
25
 
28
27
    """Component for testing execution of a bash completion script."""
29
28
 
30
29
    _test_needs_features = [features.bash_feature]
31
 
    script = None
32
30
 
33
31
    def complete(self, words, cword=-1):
34
32
        """Perform a bash completion.
97
95
class TestBashCompletion(tests.TestCase, BashCompletionMixin):
98
96
    """Test bash completions that don't execute bzr."""
99
97
 
 
98
    def __init__(self, methodName='testMethod'):
 
99
        super(TestBashCompletion, self).__init__(methodName)
 
100
        self.script = None
 
101
 
100
102
    def test_simple_scipt(self):
101
103
        """Ensure that the test harness works as expected"""
102
104
        self.script = """
153
155
    will be replaced by the bzr instance running this selftest.
154
156
    """
155
157
 
156
 
    def setUp(self):
157
 
        super(TestBashCompletionInvoking, self).setUp()
158
 
        if sys.platform == 'win32':
159
 
            raise tests.KnownFailure(
160
 
                'see bug #709104, completion is broken on windows')
 
158
    def __init__(self, methodName='testMethod'):
 
159
        super(TestBashCompletionInvoking, self).__init__(methodName)
 
160
        self.script = None
161
161
 
162
162
    def get_script(self):
163
163
        s = super(TestBashCompletionInvoking, self).get_script()
324
324
                self.assertSubset(['2a'], opt.registry_keys)
325
325
                return
326
326
        raise AssertionError('Option --format not found')
327
 
 
328
 
 
329
 
class BlackboxTests(tests.TestCase):
330
 
 
331
 
    def test_bash_completion(self):
332
 
        self.run_bzr("bash-completion")