2 from nose.plugins.base import IPluginInterface
4 class TestPluginInterfaces(unittest.TestCase):
6 def test_api_methods_present(self):
8 from nose.loader import TestLoader
9 from nose.selector import Selector
12 exclude = [ 'loadTestsFromGenerator',
13 'loadTestsFromGeneratorMethod'
16 selfuncs = [ f for f in dir(Selector)
17 if f.startswith('want') ]
18 loadfuncs = [ f for f in dir(TestLoader)
19 if f.startswith('load') and not f in exclude ]
21 others = ['addDeprecated', 'addError', 'addFailure',
22 'addSkip', 'addSuccess', 'startTest', 'stopTest',
23 'prepareTest', 'begin', 'report'
26 expect = selfuncs + loadfuncs + others
28 pd = dir(IPluginInterface)
31 assert f in pd, "No %s in IPluginInterface" % f
32 assert getattr(IPluginInterface, f).__doc__, \
33 "No docs for %f in IPluginInterface" % f
35 def test_no_instantiate(self):
37 p = IPluginInterface()
42 "Should not be able to instantiate IPluginInterface"
44 if __name__ == '__main__':