source: mauRepo/HPFos/trunk/src/HPFos/testepb.py @ 8353

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/mauRepo/HPFos/trunk/src/HPFos/testepb.py@8353
Revision 8353, 1.8 KB checked in by mnagni, 7 years ago (diff)

Removed the whole migration folder (was from the cedaManager project)

  • Property svn:mime-type set to text/plain
Line 
1'''
2Created on 10 Jan 2012
3
4@author: mnagni
5'''
6from libs.epb import EPB
7from ea_model.ceda_metadatamodel.ceda_observationcollection.ceda_observationcollection import CEDA_ObservationCollection
8from ea_model.ceda_metadatamodel.ceda_observation.ceda_observation import CEDA_Observation
9from ea_model.iso_19115_2006_metadata_corrigendum.reference_system_information.md_identifier import MD_Identifier
10from ea_model.iso_19115_2006_metadata_corrigendum.citation_and_responsible_party_information.ci_citation import CI_Citation
11from ea_model.moles3_4.observationcollection.mo_observationcollection import MO_ObservationCollection
12from ea_model.moles3_4.observation.mo_observation import MO_Observation
13from ea_model.ceda_metadatamodel.ceda_project.ceda_project import CEDA_Project
14from sqlalchemy import Table, Column, ForeignKey, Integer, String
15from sqlalchemy.orm import mapper
16from ea_model.moles3_4.utilities.mo_responsiblepartyinfo import MO_ResponsiblePartyInfo
17from ea_model.moles3_4.utilities.mo_rolevalue import MO_RoleValue
18from sqlalchemy.orm.collections import InstrumentedList
19from ceda_guid import CedaGUID
20from sqlalchemy.orm.util import identity_key
21from sqlalchemy.exc import OperationalError
22
23
24class TestEPBFactory(EPB):
25   
26    def __init__(self, dbManager):
27        self._dbManager = dbManager
28
29    def _getSession(self):
30        if self._dbManager is None:
31            raise Exception("DBManager not initialized")
32        return self._dbManager.createDbSession()           
33       
34    def createTestEPB(self):
35        return TestEPB(self._getSession())
36
37class TestEPB(object):
38
39    def __init__(self, session):
40        self._session = session
41       
42    def close(self):
43        return self._session.close()       
44
45    def selectAllTest(self):
46        return EPB.executeNative("SELECT * from test", self._session) 
Note: See TracBrowser for help on using the repository browser.