Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/mauRepo/MolesManager/trunk/src/libs/migration/tests/infodbepbtests.py@8409
Line | |
---|
1 | ''' |
---|
2 | Created on 8 Mar 2012 |
---|
3 | |
---|
4 | @author: mnagni |
---|
5 | ''' |
---|
6 | import unittest |
---|
7 | from libs.commons_db import DbManager |
---|
8 | from unittest import TestCase |
---|
9 | import logging |
---|
10 | from logging import StreamHandler |
---|
11 | from testconfig import INFO_DB_CONNECTION |
---|
12 | from libs.migration.InfodbEPB import InfodbEPB |
---|
13 | from sqlalchemy.sql.expression import text |
---|
14 | |
---|
15 | |
---|
16 | class 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 | |
---|
42 | if __name__ == "__main__": |
---|
43 | #import sys;sys.argv = ['', 'Test.testName'] |
---|
44 | unittest.main() |
---|
Note: See
TracBrowser
for help on using the repository browser.