source: mauRepo/MolesManager/trunk/src/libs/migration/tests/infodbepbtests.py @ 8222

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/mauRepo/MolesManager/trunk/src/libs/migration/tests/infodbepbtests.py@8222
Revision 8222, 1.2 KB checked in by mnagni, 8 years ago (diff)

Incomplete - # 22403: CEDA Observation - ceda Internal information
 http://team.ceda.ac.uk/trac/ceda/ticket/22403
Incomplete - # 22428: CEDA Project - observationCollection
 http://team.ceda.ac.uk/trac/ceda/ticket/22428
Complete - # 22397: CEDA Observation geographicExtent
 http://team.ceda.ac.uk/trac/ceda/ticket/22397
Incomplete - # 22385: CEDA Observation - result
 http://team.ceda.ac.uk/trac/ceda/ticket/22385

Line 
1'''
2Created on 8 Mar 2012
3
4@author: mnagni
5'''
6import unittest
7from libs.commons_db import DbManager
8from unittest import TestCase
9import logging
10from logging import StreamHandler 
11from testconfig import INFO_DB_CONNECTION
12from libs.migration.InfodbEPB import InfodbEPB
13from sqlalchemy.sql.expression import text
14
15
16class InfodbEPBTest(TestCase):
17
18    def setUp(self):     
19        InfodbEPBTest.infoDB = DbManager(INFO_DB_CONNECTION)       
20        InfodbEPB.overrrideDBManager(InfodbEPBTest.infoDB)
21        self.logging = logging.getLogger('InfodbEPB')
22        self.logging.addHandler(StreamHandler())
23        self.logging.setLevel(logging.DEBUG)
24
25    def tearDown(self):
26        pass
27        #self._dropAllTables()
28
29    def runTest(self):
30        self.getInfo()
31   
32
33    def getInfo(self):
34        connection = InfodbEPB.getNewInfoConnection();
35        query_string = text("""select id from cedainfoapp_dataentity where dataentity_id = :id""")
36        records = connection.execute(query_string, id='badc.nerc.ac.uk__ATOM__dataent_11746737105518913')
37        for rec in records:
38            print rec['id']
39        records.close()
40
41
42if __name__ == "__main__":
43    #import sys;sys.argv = ['', 'Test.testName']
44    unittest.main()
Note: See TracBrowser for help on using the repository browser.