File: test_egg_finder.py

package info (click to toggle)
pastescript 1.7.3-6
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 824 kB
  • ctags: 907
  • sloc: python: 7,307; sh: 75; makefile: 58
file content (25 lines) | stat: -rw-r--r-- 865 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
21
22
23
24
25
import os
from paste.script import pluginlib

def test_egg_info():
    egg_dir = os.path.join(os.path.dirname(__file__),
                           'fake_packages', 'FakePlugin.egg')
    found = pluginlib.find_egg_info_dir(os.path.join(egg_dir, 'fakeplugin'))
    assert found == os.path.join(egg_dir, 'FakePlugin.egg-info')
    found = pluginlib.find_egg_info_dir(os.path.dirname(__file__))
    assert found == os.path.join(
        os.path.dirname(os.path.dirname(__file__)),
        'PasteScript.egg-info')
    
def test_resolve_plugins():
    plugins = ['FakePlugin']
    all = pluginlib.resolve_plugins(plugins)
    assert all
    assert len(all) == 2

def test_find_commands():
    all = pluginlib.resolve_plugins(['PasteScript', 'FakePlugin'])
    commands = pluginlib.load_commands_from_plugins(all)
    print commands
    assert 'testcom' in commands