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

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

Incomplete - # 22490: CEDA Observation Collection - Description
 http://team.ceda.ac.uk/trac/ceda/ticket/22490

RevLine 
[8222]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)       
[8409]20        #InfodbEPB.overrrideDBManager(InfodbEPBTest.infoDB)
[8222]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   
[8409]32    '''
[8222]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()
[8409]40    '''
[8222]41
42if __name__ == "__main__":
43    #import sys;sys.argv = ['', 'Test.testName']
44    unittest.main()
Note: See TracBrowser for help on using the repository browser.