~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bashcomp.py

Added test cases for DataCollector and BashCodeGen.

Thes tests can be executed even without bash.  Instead of testing the whole
shell script, they test individual aspects of the data collection or code
generation process.  Mostly one test per method.  Already found and fixed a
bug in the method generating the version information comment.

Show diffs side-by-side

added added

removed removed

Lines of Context:
175
175
            bzr_version += " and the following plugins:"
176
176
            for name, plugin in sorted(self.data.plugins.iteritems()):
177
177
                bzr_version += "\n# %s" % plugin
 
178
        return bzr_version
178
179
 
179
180
    def global_options(self):
180
181
        return " ".join(sorted(self.data.global_options))
312
313
        if plugin_name is not None:
313
314
            if (self.selected_plugins is not None and
314
315
                plugin not in self.selected_plugins):
315
 
                return
 
316
                return None
316
317
            plugin_data = self.data.plugins.get(plugin_name)
317
318
            if plugin_data is None:
318
319
                plugin_data = PluginData(plugin_name)
339
340
            cmd_data.fixed_words = ('"$cmds %s"' %
340
341
                " ".join(sorted(help_topics.topic_registry.keys())))
341
342
 
 
343
        return cmd_data
 
344
 
342
345
    def option(self, opt):
343
346
        optswitches = {}
344
347
        parser = option.get_optparser({opt.name: opt})