~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_options.py

  • Committer: Jonathan Lange
  • Date: 2009-06-26 08:46:52 UTC
  • mto: (4484.1.1 bring-1.16.1-back)
  • mto: This revision was merged to the branch mainline in revision 4485.
  • Revision ID: jml@canonical.com-20090626084652-x7wn8yimd3fj0j0y
Tweak NEWS slightly based on mbp's feedback.

Show diffs side-by-side

added added

removed removed

Lines of Context:
324
324
 
325
325
    def get_builtin_command_options(self):
326
326
        g = []
327
 
        for cmd_name in sorted(commands.all_command_names()):
328
 
            cmd = commands.get_cmd_object(cmd_name)
 
327
        for cmd_name, cmd_class in sorted(commands.get_all_cmds()):
 
328
            cmd = cmd_class()
329
329
            for opt_name, opt in sorted(cmd.options().items()):
330
330
                g.append((cmd_name, opt))
331
331
        return g
338
338
        g = dict(option.Option.OPTIONS.items())
339
339
        used_globals = {}
340
340
        msgs = []
341
 
        for cmd_name in sorted(commands.all_command_names()):
342
 
            cmd = commands.get_cmd_object(cmd_name)
343
 
            for option_or_name in sorted(cmd.takes_options):
 
341
        for cmd_name, cmd_class in sorted(commands.get_all_cmds()):
 
342
            for option_or_name in sorted(cmd_class.takes_options):
344
343
                if not isinstance(option_or_name, basestring):
345
344
                    self.assertIsInstance(option_or_name, option.Option)
346
345
                elif not option_or_name in g:
347
346
                    msgs.append("apparent reference to undefined "
348
347
                        "global option %r from %r"
349
 
                        % (option_or_name, cmd))
 
348
                        % (option_or_name, cmd_class))
350
349
                else:
351
350
                    used_globals.setdefault(option_or_name, []).append(cmd_name)
352
351
        unused_globals = set(g.keys()) - set(used_globals.keys())