~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Patch Queue Manager
  • Date: 2016-02-01 19:56:05 UTC
  • mfrom: (6615.1.1 trunk)
  • Revision ID: pqm@pqm.ubuntu.com-20160201195605-o7rl92wf6uyum3fk
(vila) Open trunk again as 2.8b1 (Vincent Ladeuil)

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
 
17
19
import bzrlib
18
20
from bzrlib import commands, tests
19
21
from bzrlib.tests import features
20
22
from bzrlib.plugins.bash_completion.bashcomp import *
21
23
 
22
 
import os
23
24
import subprocess
24
25
 
25
26
 
27
28
    """Component for testing execution of a bash completion script."""
28
29
 
29
30
    _test_needs_features = [features.bash_feature]
 
31
    script = None
30
32
 
31
33
    def complete(self, words, cword=-1):
32
34
        """Perform a bash completion.
95
97
class TestBashCompletion(tests.TestCase, BashCompletionMixin):
96
98
    """Test bash completions that don't execute bzr."""
97
99
 
98
 
    def __init__(self, methodName='testMethod'):
99
 
        super(TestBashCompletion, self).__init__(methodName)
100
 
        self.script = None
101
 
 
102
100
    def test_simple_scipt(self):
103
101
        """Ensure that the test harness works as expected"""
104
102
        self.script = """
155
153
    will be replaced by the bzr instance running this selftest.
156
154
    """
157
155
 
158
 
    def __init__(self, methodName='testMethod'):
159
 
        super(TestBashCompletionInvoking, self).__init__(methodName)
160
 
        self.script = None
 
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')
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")