source: MILK/trunk/milk_server/milk_server/tests/__init__.py @ 2624

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/MILK/trunk/milk_server/milk_server/tests/__init__.py@4456
Revision 2624, 884 bytes checked in by spascoe, 13 years ago (diff)

Removed the extract test cases. They have moved to the CSML tree.

Line 
1import os
2import sys
3from unittest import TestCase
4
5here_dir = os.path.dirname(os.path.abspath(__file__))
6conf_dir = os.path.dirname(os.path.dirname(here_dir))
7
8sys.path.insert(0, conf_dir)
9
10import pkg_resources
11
12pkg_resources.working_set.add_entry(conf_dir)
13
14pkg_resources.require('Paste')
15pkg_resources.require('PasteScript')
16
17from paste.deploy import loadapp
18import paste.fixture
19import paste.script.appinstall
20
21from ows_server.config.routing import *
22from routes import request_config, url_for
23
24test_file = os.path.join(conf_dir, 'test.ini')
25cmd = paste.script.appinstall.SetupCommand('setup-app')
26cmd.run([test_file])
27
28class TestController(TestCase):
29    def __init__(self, *args):
30        wsgiapp = loadapp('config:test.ini', relative_to=conf_dir)
31        self.app = paste.fixture.TestApp(wsgiapp)
32        TestCase.__init__(self, *args)
33
34__all__ = ['url_for', 'TestController']
Note: See TracBrowser for help on using the repository browser.