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

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/MILK/trunk/milk_server/milk_server/tests/__init__.py@4472
Revision 4472, 885 bytes checked in by cbyrom, 12 years ago (diff)

Strip out code not relevant to MILK - mainly WCS and WMS stuff - also including the CSML server code + trackback code
Also tidy up structure of 'public' dir - setting up new 'style' dir and
centralising icons in icons dir + remove all unused icons, javascript and stylesheets.
Also strip out testcase code and populate new test directory structure.

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 milk_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.