source: mauRepo/HPFos/trunk/src/tests/testconfig.py @ 8354

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/mauRepo/HPFos/trunk/src/tests/testconfig.py@8364
Revision 8354, 2.4 KB checked in by mnagni, 8 years ago (diff)

Implemented the bbox query URL (at least for the CEDA_ObservationCollection)

Line 
1'''
2BSD Licence
3Copyright (c) 2012, Science & Technology Facilities Council (STFC)
4All rights reserved.
5
6Redistribution and use in source and binary forms, with or without modification,
7are permitted provided that the following conditions are met:
8
9    * Redistributions of source code must retain the above copyright notice,
10        this list of conditions and the following disclaimer.
11    * Redistributions in binary form must reproduce the above copyright notice,
12        this list of conditions and the following disclaimer in the documentation
13        and/or other materials provided with the distribution.
14    * Neither the name of the Science & Technology Facilities Council (STFC)
15        nor the names of its contributors may be used to endorse or promote
16        products derived from this software without specific prior written permission.
17
18THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
20THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
21PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
22BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
23OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28
29Created on 7 Mar 2012
30
31@author: Maurizio Nagni
32'''
33from libs.commons_db import DbManager
34from HPFos.moles3epb import Moles3EPBFactory
35from libs.epb import EPB
36MOLES3_DB_CONNECTION = 'postgresql://badc:rotyn217m@neptune.badc.rl.ac.uk:5432/Moles3_dev1'
37POSTGIS_DB_CONNECTION = 'postgresql://badc:rotyn217m@neptune.badc.rl.ac.uk:5432/Moles3'
38
39from sqlTables import doTables as doMoles, attachEvents
40MOLES3_DB_SCRIPT = doMoles
41EVENTS_DB = attachEvents
42
43"""
44    Represents the access to the Moles database.
45    Creates from the existing db connections pools a new session
46    to be used by all the DB operations involved in the actual HTTPRequest
47"""                   
48molesDB = DbManager(MOLES3_DB_CONNECTION, MOLES3_DB_SCRIPT)
49test_moles3EPBFactory = Moles3EPBFactory(molesDB)
50
51
52def getMoles3EPB():
53    return test_moles3EPBFactory.createEPB()
54
55def closeEPB(epb):
56    epb.close() 
Note: See TracBrowser for help on using the repository browser.