Exemple #1
0
 def test_invoked_as(self):
     """The command object knows the actual name used to invoke it."""
     commands.install_bzr_command_hooks()
     commands._register_builtin_commands()
     # get one from the real get_cmd_object.
     c = commands.get_cmd_object('ci')
     self.assertIsInstance(c, builtins.cmd_commit)
     self.assertEqual(c.invoked_as, 'ci')
Exemple #2
0
 def test_invoked_as(self):
     """The command object knows the actual name used to invoke it."""
     commands.install_bzr_command_hooks()
     commands._register_builtin_commands()
     # get one from the real get_cmd_object.
     c = commands.get_cmd_object("ci")
     self.assertIsInstance(c, builtins.cmd_commit)
     self.assertEquals(c.invoked_as, "ci")
Exemple #3
0
 def test_all_commands_have_help(self):
     commands._register_builtin_commands()
     commands_without_help = set()
     base_doc = inspect.getdoc(commands.Command)
     for cmd_name in commands.all_command_names():
         cmd = commands.get_cmd_object(cmd_name)
         cmd_help = cmd.help()
         if not cmd_help or cmd_help == base_doc:
             commands_without_help.append(cmd_name)
     self.assertLength(0, commands_without_help)
Exemple #4
0
 def test_all_commands_have_help(self):
     commands._register_builtin_commands()
     commands_without_help = set()
     base_doc = inspect.getdoc(commands.Command)
     for cmd_name in commands.all_command_names():
         cmd = commands.get_cmd_object(cmd_name)
         cmd_help = cmd.help()
         if not cmd_help or cmd_help == base_doc:
             commands_without_help.append(cmd_name)
     self.assertLength(0, commands_without_help)
Exemple #5
0
if __name__ == '__main__':
    import bzrlib
    bzrlib.initialize()
    try:
        from bzrlib.commands import _register_builtin_commands
        _register_builtin_commands()
    except ImportError:
        pass
    import bzrlib.plugin
    bzrlib.plugin.set_plugins_path()
    bzrlib.plugin.load_plugins()

from bzrlib.plugins.qbzr.lib.tests import QTestCase
from PyQt4 import QtCore
from PyQt4.QtTest import QTest

from bzrlib.plugins.qbzr.lib.diffwindow import DiffWindow
from bzrlib.plugins.qbzr.lib.shelvewindow import ShelveWindow
from bzrlib.plugins.qbzr.lib.annotate import AnnotateWindow


class WtDiffArgProvider(object):
    def __init__(self, tree):
        self.tree = tree

    def get_diff_window_args(self, processEvents, add_cleanup):
        return dict(old_tree=self.tree.basis_tree(),
                    new_tree=self.tree,
                    old_branch=self.tree.branch,
                    new_branch=self.tree.branch)