Commits

Jason Pellerin committed 1a5688a

Added test for entrypoint name fix

Comments (0)

Files changed (8)

functional_tests/support/ep/Some_plugin.egg-info/PKG-INFO

+Metadata-Version: 1.0
+Name: Some-plugin
+Version: 0.0.0
+Summary: UNKNOWN
+Home-page: UNKNOWN
+Author: UNKNOWN
+Author-email: UNKNOWN
+License: UNKNOWN
+Description: UNKNOWN
+Platform: UNKNOWN

functional_tests/support/ep/Some_plugin.egg-info/SOURCES.txt

+setup.py
+Some_plugin.egg-info/PKG-INFO
+Some_plugin.egg-info/SOURCES.txt
+Some_plugin.egg-info/dependency_links.txt
+Some_plugin.egg-info/entry_points.txt
+Some_plugin.egg-info/top_level.txt

functional_tests/support/ep/Some_plugin.egg-info/dependency_links.txt

+

functional_tests/support/ep/Some_plugin.egg-info/entry_points.txt

+[nose.plugins.0.10]
+someplugin = someplugin:SomePlugin
+

functional_tests/support/ep/Some_plugin.egg-info/top_level.txt

+

functional_tests/support/ep/setup.py

+from setuptools import setup, find_packages
+
+setup(
+    name='Some plugin',
+    packages = find_packages(),
+    entry_points = {
+    'nose.plugins.0.10': [
+    'someplugin = someplugin:SomePlugin'
+    ]
+    })

functional_tests/support/ep/someplugin.py

+from nose.plugins import Plugin
+
+class SomePlugin(Plugin):
+    pass

functional_tests/test_entrypoints.py

+import os
+import sys
+from nose.exc import SkipTest
+
+try:
+    from pkg_resources import EntryPoint
+except ImportError:
+    raise SkipTest("No setuptools available; skipping")
+
+here = os.path.dirname(__file__)
+support = os.path.join(here, 'support')
+ep = os.path.join(support, 'ep')
+
+
+def test_plugin_entrypoint_is_loadable():
+    epfile = os.path.join(ep, 'Some_plugin.egg-info', 'entry_points.txt')
+    assert EntryPoint.parse_map(open(epfile, 'r').readlines())