##// END OF EJS Templates
Fix rpmlint: non-executable-script...
Fix rpmlint: non-executable-script """ This text file contains a shebang or is located in a path dedicated for executables, but lacks the executable bits and cannot thus be executed. If the file is meant to be an executable script, add the executable bits, otherwise remove the shebang or move the file elsewhere. """ Mostly deleting the shebang, but some files contain a __main__ function, so make them executable. This is the last commit of this series and: Closes gh-647.

File last commit:

r2738:95a4f176
r4574:a8c54759
Show More
test_plugin.py
46 lines | 1.3 KiB | text/x-python | PythonLexer
"""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'))