source: TI05-delivery/ows_framework/trunk/ows_server/ows_server/tests/__init__.py @ 2594

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI05-delivery/ows_framework/trunk/ows_server/ows_server/tests/__init__.py@2594
Revision 2594, 942 bytes checked in by spascoe, 13 years ago (diff)

Various changes. Some test data is generated with make_data.py and this
is used to test the csml_wms controller. These tests pass.

Also there are some subsetToGridSeries tests. These fail at the moment. They need refining to check they are valid tests.

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
35
36# Generate test data
37import make_data
38make_data.main()
39
40__all__ = ['url_for', 'TestController']
Note: See TracBrowser for help on using the repository browser.