~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/selftest/testplugins.py

- fix indents

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
 
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')
34
 
        f.write(PLUGIN_TEXT)
35
 
        f.close()
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
40
 
 
41
 
        assert backtick('bzr commit -m test') == "I'm sorry dave, you can't do that\n"
42
 
 
43
 
        shutil.rmtree('plugin_test')
44
 
 
 
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)
 
35
#        f.close()
 
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
 
40
#
 
41
#        assert backtick('bzr commit -m test') == "I'm sorry dave, you can't do that\n"
 
42
#
 
43
#        shutil.rmtree('plugin_test')
 
44
#
45
45
 
46
46
#         os.environ['BZRPLUGINPATH'] = os.path.abspath('plugin_test')
47
47
#         help = backtick('bzr help commands')
67
67
 
68
68
#         """
69
69
 
70
 
 PLUGIN_TEXT = """\
71
 
 import bzrlib.commands
72
 
 class cmd_myplug(bzrlib.commands.Command):
73
 
     '''Just a simple test plugin.'''
74
 
     aliases = ['mplg']
75
 
     def run(self):
76
 
         print 'Hello from my plugin'
77
 
 """
78
 
 
 
70
PLUGIN_TEXT = """\
 
71
import bzrlib.commands
 
72
class cmd_myplug(bzrlib.commands.Command):
 
73
    '''Just a simple test plugin.'''
 
74
    aliases = ['mplg']
 
75
    def run(self):
 
76
        print 'Hello from my plugin'
 
77
"""