28
28
class PluginTest(TestCaseInTempDir):
29
29
"""Create an external plugin and test loading."""
30
def test_plugin_loading(self):
31
orig_help = self.run_bzr_captured('bzr help commands')[0]
32
os.mkdir('plugin_test')
33
f = open(os.path.join('plugin_test', 'myplug.py'), 'wt')
36
newhelp = self.run_bzr_captured('bzr help commands')[0]
37
assert newhelp.startswith('You have been overridden\n')
38
# We added a line, but the rest should work
39
assert newhelp[25:] == help
41
assert backtick('bzr commit -m test') == "I'm sorry dave, you can't do that\n"
43
shutil.rmtree('plugin_test')
30
# def test_plugin_loading(self):
31
# orig_help = self.run_bzr_captured('bzr help commands')[0]
32
# os.mkdir('plugin_test')
33
# f = open(os.path.join('plugin_test', 'myplug.py'), 'wt')
34
# f.write(PLUGIN_TEXT)
36
# newhelp = self.run_bzr_captured('bzr help commands')[0]
37
# assert newhelp.startswith('You have been overridden\n')
38
# # We added a line, but the rest should work
39
# assert newhelp[25:] == help
41
# assert backtick('bzr commit -m test') == "I'm sorry dave, you can't do that\n"
43
# shutil.rmtree('plugin_test')
46
46
# os.environ['BZRPLUGINPATH'] = os.path.abspath('plugin_test')
47
47
# help = backtick('bzr help commands')
71
import bzrlib.commands
72
class cmd_myplug(bzrlib.commands.Command):
73
'''Just a simple test plugin.'''
76
print 'Hello from my plugin'
71
import bzrlib.commands
72
class cmd_myplug(bzrlib.commands.Command):
73
'''Just a simple test plugin.'''
76
print 'Hello from my plugin'