~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Martin von Gagern
  • Date: 2010-05-25 11:20:16 UTC
  • mto: This revision was merged to the branch mainline in revision 5255.
  • Revision ID: martin.vgagern@gmx.net-20100525112016-p25dj7mdiw00hfqb
Move ExecutableFeature instances to tests.features module.

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
import subprocess
23
23
 
24
24
 
25
 
BashFeature = tests.features.ExecutableFeature('bash')
26
 
SedFeature = tests.features.ExecutableFeature('sed')
27
 
 
28
 
 
29
25
class BashCompletionMixin(object):
30
26
    """Component for testing execution of a bash completion script."""
31
27
 
32
 
    _test_needs_features = [BashFeature]
 
28
    _test_needs_features = [tests.features.bash_feature]
33
29
 
34
30
    def complete(self, words, cword=-1):
35
31
        """Perform a bash completion.
39
35
        """
40
36
        if self.script is None:
41
37
            self.script = self.get_script()
42
 
        proc = subprocess.Popen([BashFeature.path, '--noprofile'],
 
38
        proc = subprocess.Popen([tests.features.bash_feature.path,
 
39
                                 '--noprofile'],
43
40
                                stdin=subprocess.PIPE,
44
41
                                stdout=subprocess.PIPE,
45
42
                                stderr=subprocess.PIPE)
166
163
        return s.replace("$(bzr ", "$('%s' " % self.get_bzr_path())
167
164
 
168
165
    def test_revspec_tag_all(self):
169
 
        self.requireFeature(SedFeature)
 
166
        self.requireFeature(tests.features.sed_feature)
170
167
        wt = self.make_branch_and_tree('.', format='dirstate-tags')
171
168
        wt.branch.tags.set_tag('tag1', 'null:')
172
169
        wt.branch.tags.set_tag('tag2', 'null:')
175
172
        self.assertCompletionEquals('tag1', 'tag2', '3tag')
176
173
 
177
174
    def test_revspec_tag_prefix(self):
178
 
        self.requireFeature(SedFeature)
 
175
        self.requireFeature(tests.features.sed_feature)
179
176
        wt = self.make_branch_and_tree('.', format='dirstate-tags')
180
177
        wt.branch.tags.set_tag('tag1', 'null:')
181
178
        wt.branch.tags.set_tag('tag2', 'null:')