summaryrefslogtreecommitdiff
path: root/tests/fixture.py
blob: 751659dcf5943b9bfe0070cd07de9a76281db539 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import os
import sys
import shutil

test_dir = os.path.dirname(__file__)
egg_info_dir = os.path.join(test_dir, 'fake_packages', 'FakeApp.egg',
                            'EGG-INFO')
info_dir = os.path.join(test_dir, 'fake_packages', 'FakeApp.egg',
                        'FakeApp.egg-info')
if not os.path.exists(egg_info_dir):
    try:
        os.symlink(info_dir, egg_info_dir)
    except:
        shutil.copytree(info_dir, egg_info_dir)

sys.path.append(os.path.dirname(egg_info_dir))

from pkg_resources import *
working_set.add_entry(os.path.dirname(egg_info_dir))
require('FakeApp')