##// END OF EJS Templates
Add custom_control and custom_page_control variables to override the Qt widgets used by qtconsole...
Add custom_control and custom_page_control variables to override the Qt widgets used by qtconsole - This will let other project to easily provide its own widgets - Try to fix #1920

File last commit:

r2738:95a4f176
r7657:6173df69
Show More
test_plugin.py
46 lines | 1.3 KiB | text/x-python | PythonLexer
Brian Granger
Finishing work on configurables, plugins and extensions.
r2738 """Tests for plugin.py"""
#-----------------------------------------------------------------------------
# Imports
#-----------------------------------------------------------------------------
from unittest import TestCase
from IPython.core.plugin import Plugin, PluginManager
#-----------------------------------------------------------------------------
# Tests
#-----------------------------------------------------------------------------
class FooPlugin(Plugin):
pass
class BarPlugin(Plugin):
pass
class BadPlugin(object):
pass
class PluginTest(TestCase):
def setUp(self):
self.manager = PluginManager()
def test_register_get(self):
self.assertEquals(None, self.manager.get_plugin('foo'))
foo = FooPlugin()
self.manager.register_plugin('foo', foo)
self.assertEquals(foo, self.manager.get_plugin('foo'))
bar = BarPlugin()
self.assertRaises(KeyError, self.manager.register_plugin, 'foo', bar)
bad = BadPlugin()
self.assertRaises(TypeError, self.manager.register_plugin, 'bad')
def test_unregister(self):
foo = FooPlugin()
self.manager.register_plugin('foo', foo)
self.manager.unregister_plugin('foo')
self.assertEquals(None, self.manager.get_plugin('foo'))