File: test_entrypoints.py

package info (click to toggle)
nose 1.3.7-9
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 2,900 kB
  • sloc: python: 15,733; makefile: 99; xml: 42; sh: 2
file content (20 lines) | stat: -rw-r--r-- 524 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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():
    ep_path = os.path.join(ep, 'Some_plugin.egg-info', 'entry_points.txt')
    ep_file = open(ep_path, 'r')
    lines = ep_file.readlines()
    ep_file.close()
    assert EntryPoint.parse_map(lines)