- Timestamp:
- 02/09/08 16:41:35 (13 years ago)
- Location:
- exist/trunk/python/ndgUtils
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
exist/trunk/python/ndgUtils/DocumentRetrieve.py
r4037 r4160 1 1 from eXistInterface import ndg_eXist 2 2 from ndgXqueries import ndgXqueries 3 import urllib2 3 from ndgObject import ndgObject 4 5 import urllib2, logging, socket 4 6 try: 5 7 from xml.etree import ElementTree as ET … … 13 15 14 16 debug=0 17 18 19 def httpify(url): 20 ''' 21 Ensure a url has an http prefix 22 ''' 23 if url[0:4] != 'http': 24 url = 'http://' + url 25 return url 15 26 16 class DocumentRetrieve (ndg_eXist): 27 28 class DocumentRetrieve(ndg_eXist): 17 29 ''' This class provides a document retrieval service via the NDG exist interfaces ''' 18 def __init__(self,repository,pwfile='passwords.txt'): 30 def __init__(self, repository, pwfile='passwords.txt'): 31 logging.info("Using repository, '%s'" %repository) 19 32 20 ndg_eXist.__init__(self,db=repository,passwordFile=pwfile) 33 ndg_eXist.__init__(self, db=repository, passwordFile=pwfile) 34 logging.info("DB connection initialised") 21 35 self.repository=repository 22 36 self.xq=ndgXqueries() 23 37 self.knownQueries={'DIF':'moles2dif','DC':'moles2DC','ISO19139':'moles2iso19139', 24 'NDG-B0':'moles','NDG-B1':'molesObjectType','MDIP':'moles2mdip'} 38 'NDG-B0':'moles','NDG-B1':'molesObjectType','MDIP':'moles2mdip', 39 'NDG-A0':'csml','NumSim':'numsim', 'ATOM':'atom'} 40 41 def _retrieveDoc(self, schema, xqtype, targetCollection, repository, localID): 42 ''' 43 Retrieve doc using specified XQuery type 44 @return: docName, docContents 45 ''' 46 logging.debug("Retrieving doc - type, '%s', coll, '%s', rep:'%s', localID:'%s'" \ 47 %(xqtype,targetCollection,repository,localID)) 48 xquery=self.xq.actual(xqtype,targetCollection,repository,localID) 49 50 id,summary=self.executeQuery(xquery) 51 if summary['hits'] != 1: 52 raise ValueError('Unable to obtain single %s document [%s] (hits=%s)'\ 53 %(schema,localID,summary['hits'])) 54 55 docName = summary['documents'][0][0] 56 r=self.retrieve(id,0,{}) 57 self.sessionRelease(id) 58 return docName, r 59 25 60 26 61 def get(self,repository,schema,localID,targetCollection='/db/discovery/moles', includeDocNameData=False): … … 29 64 being the name of the document and the entry being the dataset 30 65 ''' 66 logging.debug("Get called with rep:'%s', schema:'%s', localID:'%s', collection:'%s'" \ 67 %(repository,schema,localID,targetCollection)) 31 68 docName = "" 32 if schema in ['NDG-A0', 'NumSim', 'G_ATOM']: 33 ''' These documents are stored in their own native format and have their 34 own native xqueries ''' 35 query={'NDG-A0':'csml','NumSim':'numsim', 'G_ATOM':'granuleAtom'}[schema] 36 xquery=self.xq.actual(query,targetCollection,repository,localID) 37 print xquery 38 id,summary=self.executeQuery(xquery) 39 if summary['hits'] != 1: 40 raise ValueError('Unable to obtain single %s document [%s] (hits=%s)'%(schema,localID,summary['hits'])) 69 if schema not in self.knownQueries: 70 raise TypeError('Unknown Schema "%s" in URI'%schema) 41 71 42 docName = summary['documents'][0][0] 43 r=self.retrieve(id,0,{}) 44 self.sessionRelease(id) 45 if includeDocNameData: 46 return {docName: r} 47 return r 48 49 elif schema[0:5] == 'NDG-B' or schema in self.knownQueries: 50 ''' These documents are stored in moles, and need to be converted or extracted 51 directly ''' 72 xqtype=self.knownQueries[schema] 73 74 if schema == 'NDG-B1': 75 # this is a general moles object - so need to further establish the type of moles doc 76 # it is to get the correct XQUery to use 77 name, xml = self._retrieveDoc(schema, xqtype, targetCollection, \ 78 repository, localID) 79 xml=ET.fromstring(xml) 80 otype=int(xml.text or 0) 52 81 53 xqtype=self.knownQueries[schema] 54 55 if xqtype=='molesObjectType': 56 #We need to know what sort of moles thing it is to get the correct query 57 xquery=self.xq.actual(xqtype,targetCollection,repository,localID) 58 id,summary=self.executeQuery(xquery) 59 hits=summary['hits'] 60 61 if hits!=1: 62 self.error('%s documents returned! '%hits,targetCollection,repository,'NDG-B0',localID) 63 64 # get output type 65 r=self.retrieve(id,0,{}) 66 xml=ET.fromstring(r) 67 otype=int(xml.text or 0) 68 69 xqtype={4:'stubB_dataEntity', 70 3:'stubB_observationStation', 71 2:'stubB_DPT', 72 1:'stubB_activity'}[otype] 73 74 #now get the real xquery 75 xquery=self.xq.actual(xqtype,targetCollection,repository,localID) 76 77 try: 78 id,summary=self.executeQuery(xquery) 79 except Exception,e: 80 print xquery 81 raise Exception,e 82 hits=summary['hits'] 83 # should only be the one document in the result set 84 if hits!=1: 85 self.error('Document Query returned [%s] hits'%hits,targetCollection,repository,schema,localID) 86 87 docName = summary['documents'][0][0] 88 # now let's get it and return it 89 r=self.retrieve(id,0,{}) 90 else: 91 raise TypeError('Unknown Schema "%s" in URI'%schema) 92 self.sessionRelease(id) 82 xqtype={4:'stubB_dataEntity', 83 3:'stubB_observationStation', 84 2:'stubB_DPT', 85 1:'stubB_activity'}[otype] 86 87 docName, r = self._retrieveDoc(schema, xqtype, targetCollection, 88 repository, localID) 93 89 if includeDocNameData: 94 90 return {docName: r} … … 98 94 def error(self,string,t,r,s,l): 99 95 raise ValueError,string+' for %s:%s:%s in %s'%(r,s,l,t) 96 100 97 101 98 class genericHTTP(object): … … 105 102 proxyHandler=urllib2.ProxyHandler({}) 106 103 else: 107 proxy=proxyServer 108 if proxy[0:4]!='http':proxy='http://'+proxy 104 proxy=httpify(proxyServer) 109 105 proxyHandler=urllib2.ProxyHandler({'http':proxy}) 110 106 self.opener=urllib2.build_opener(proxyHandler) 111 107 112 108 def get(self,url): 109 url = httpify(url) 113 110 request=urllib2.Request(url) 111 logging.info("Getting data from url: %s" %url) 114 112 response='Cannot obtain remote file: ' 115 113 try: … … 125 123 except Exception,e: 126 124 response+='[%s]'%str(e) 125 127 126 if response=='': 128 127 return f.read() 129 128 else: 130 129 raise IOError(response) 130 131 131 132 132 class ndgHTTP(genericHTTP): … … 144 144 #TODO what about security? Probably means we need to get the headers of our responses sorted ... 145 145 url='%s/retrieve/%s__%s__%s'%(self.remoteHost,repository,schema,localID) 146 print url147 #http://docs.python.org/lib/urllib2-examples.html148 146 return genericHTTP.get(self,url) 149 147 … … 151 149 ''' Use a usercode password to set security credentials at a specific location ''' 152 150 pass 151 153 152 154 153 class ndgVocabPOX(genericHTTP): -
exist/trunk/python/ndgUtils/eXistConnector.py
r4037 r4160 44 44 def __init__(self,constants=None): 45 45 ''' Instantiates the eXist connector using supplied constants ''' 46 logging.debug("Setting up xmlrpc connection to eXist") 46 47 if constants is None: raise 'NoExistConstants' 48 logging.debug("Host: '%s', User: '%s'" %(constants.host, constants.userid)) 47 49 authinfo = urllib2.HTTPPasswordMgrWithDefaultRealm() 48 50 authinfo.add_password(None, … … 68 70 ) 69 71 self.xmlrpc = xmlrpclib.Server(xmlrpc_uri) 72 logging.debug("xmlrpc connection set up") 73 70 74 71 75 def executeQuery(self, xquery, params={}): 72 76 '''Execute an xquery string, return session and summary information''' 77 logging.debug("Executing xquery on eXist:\n%s" %xquery) 73 78 xquery=xmlrpclib.Binary(xquery) 74 79 id = self.xmlrpc.executeQuery(xquery, params) 75 80 summary = self.xmlrpc.querySummary(id) 81 logging.debug("XQuery executed") 76 82 return id,summary 77 83 … … 82 88 def retrieve(self,id,pos,params={}): 83 89 ''' Retrieve a specific document from an executeQuery result set ''' 84 return self.xmlrpc.retrieve(id,pos,params).data 90 logging.debug("Retrieving document from eXist...") 91 xml = self.xmlrpc.retrieve(id,pos,params).data 92 logging.debug("Document retrieved.") 93 return xml 85 94 86 95 def executeChunkedQuery(self,xquery,start,number,params={}): -
exist/trunk/python/ndgUtils/eXistInterface.py
r3989 r4160 1 1 from eXistConnector import * 2 2 from ndgXqueries import ndgXqueries 3 import xmlHandler2 3 import xmlHandler2, logging 4 4 5 5 class ndg_eXist(eXistConnector): 6 6 ''' Adds ndg methods to a "standard" exist Connector ''' 7 7 def __init__(self,db='glue.badc.rl.ac.uk',passwordFile='passwords.txt'): 8 logging.debug("Initialising connection to eXist DB") 8 9 try: 9 10 f=file(passwordFile,'r') … … 27 28 eXistConnector.__init__(self,eXistConstants) 28 29 self.ids={} 30 logging.debug("Connection initialised") 31 29 32 30 33 def __buildquery(self,query,target=None): -
exist/trunk/python/ndgUtils/ndgObject.py
r3500 r4160 1 import ndgRetrieve,xmlHandler2 1 import ndgRetrieve,xmlHandler2, logging 2 2 3 3 class ndgObject: … … 8 8 def __init__(self,uri,config=None): 9 9 ''' Parse the uri and prepare for obtaining the actual content''' 10 10 logging.debug("Initialising ndgObject with uri: '%s'" %uri) 11 11 #Dom had problem with unicode coming in here ... dunno why @@@@ 12 12 uri=str(uri) … … 41 41 # after all that, we don't think it's an NDG URI ... 42 42 raise ValueError,'The identifier [%s] is not a valid NDG style URI'%uri 43 else: 44 # yes, it is an NDG URI ... 45 self.repository,self.schema,self.localID=repository,schema,localID 46 43 44 # yes, it is an NDG URI ... 45 self.repository,self.schema,self.localID=repository,schema,localID 46 logging.debug("Extracted valid NDG values from URI: repository: '%s', schema: '%s', localID: '%s'" \ 47 %(repository, schema, localID)) 47 48 self.setConfig(config) 48 49 49 50 def setConfig(self,config): 50 ''' Set up the configuration for retrieving this document ''' 51 ''' 52 Set up the configuration for retrieving this document 53 ''' 54 logging.debug("Setting up configuration for retrieving document") 51 55 self.config=config 52 56 if config is None: 53 57 self.discoveryURL,self.baseURL,self.xmlURL,self.printableURL=None,None,None,None 54 58 self.BURL=None 59 return 60 61 self.server=self.config.get('DISCOVERY','default') 62 server=self.server 63 qs=None 64 # This NDG object may itself be a discovery record, which makes life easy, but 65 # it might not be, in which case we have to build up all the possible views upon it. 66 # But remember only data entity b records have discovery records ... 67 self.viewService='%s/view/'%server 68 discoveryBASE='%s%s__%s__%s'%(self.viewService,self.repository,self.schema,self.localID) 69 fmt=self.config.get('DISCOVERY','formatDefault','DIF') 70 self.BURL=None 71 # We'll build the following even if it can't be used (as would be the case for 72 # a non data entity B record or an A record) because it's a useful template. 73 if self.schema!=fmt: qs=('outputSchema',fmt) 74 self.discoveryURL=self.__buildURL(discoveryBASE,[qs]) 75 servicehost=self.config.get('NDG_B_SERVICE',self.repository,'unknown') 76 # If this record is itself a discovery record, then we don't have much more to do 77 if self.schema in ['DIF','DC','MDIP','ISO19139']: 78 self.xmlURL=self.__buildURL( 79 discoveryBASE.replace('/view/','/retrieve/'),[qs,('format','raw')]) 80 self.printableURL=self.__buildURL(discoveryBASE,[qs,('format','xml')]) 81 self.URL=self.discoveryURL 82 if servicehost!='unknown':self.gettable=1 83 elif self.schema in ['NDG-B0','NDG-B1','NumSim']: 84 # One day we'll use a service binding to get this 85 # This is a mapping from the ndg repository id to an actual repository id 86 # understood by the ndg exist interface 87 blank=self.config.get('NDG_B_SERVICE','instance') 88 url=blank.replace('SERVICEHOST',servicehost) 89 url=url.replace('URI',self.uri) 90 self.URL=url 91 self.xmlURL=url.replace('/view/','/retrieve/')+'?format=raw' 92 self.printableURL=url+'?format=xml' 93 if servicehost!='unknown': self.gettable=0 55 94 else: 56 self.server=self.config.get('DISCOVERY','default') 57 server=self.server 58 qs=None 59 # This NDG object may itself be a discovery record, which makes life easy, but 60 # it might not be, in which case we have to build up all the possible views upon it. 61 # But remember only data entity b records have discovery records ... 62 self.viewService='%s/view/'%server 63 discoveryBASE='%s%s__%s__%s'%(self.viewService,self.repository,self.schema,self.localID) 64 fmt=self.config.get('DISCOVERY','formatDefault','DIF') 65 self.BURL=None 66 # We'll build the following even if it can't be used (as would be the case for 67 # a non data entity B record or an A record) because it's a useful template. 68 if self.schema!=fmt: qs=('outputSchema',fmt) 69 self.discoveryURL=self.__buildURL(discoveryBASE,[qs]) 70 servicehost=self.config.get('NDG_B_SERVICE',self.repository,'unknown') 71 # If this record is itself a discovery record, then we don't have much more to do 72 if self.schema in ['DIF','DC','MDIP','ISO19139']: 73 self.xmlURL=self.__buildURL( 74 discoveryBASE.replace('/view/','/retrieve/'),[qs,('format','raw')]) 75 self.printableURL=self.__buildURL(discoveryBASE,[qs,('format','xml')]) 76 self.URL=self.discoveryURL 77 if servicehost!='unknown':self.gettable=1 78 elif self.schema in ['NDG-B0','NDG-B1','NumSim']: 79 # One day we'll use a service binding to get this 80 # This is a mapping from the ndg repository id to an actual repository id 81 # understood by the ndg exist interface 82 blank=self.config.get('NDG_B_SERVICE','instance') 83 url=blank.replace('SERVICEHOST',servicehost) 84 url=url.replace('URI',self.uri) 85 self.URL=url 86 self.xmlURL=url.replace('/view/','/retrieve/')+'?format=raw' 87 self.printableURL=url+'?format=xml' 88 if servicehost!='unknown': self.gettable=0 89 else: 90 #currently we don't know how to get this one 91 self.URL='unknown' 92 self.discoveryURL,self.baseURL,self.xmlURL,self.printableURL=None,None,None,None 93 94 #now, we'll build a stub-B url as well, in case that comes in handy 95 if self.schema!='NumSim' and self.gettable<>-1: 96 self.BURL=discoveryBASE.replace(self.schema,'NDG-B1') 97 self.BURL=self.BURL.replace(server,servicehost) 95 #currently we don't know how to get this one 96 self.URL='unknown' 97 self.discoveryURL,self.baseURL,self.xmlURL,self.printableURL=None,None,None,None 98 99 logging.debug("Set up URL: '%s'\ndiscoveryURL: '%s'" %(self.URL, self.discoveryURL)) 100 101 #now, we'll build a stub-B url as well, in case that comes in handy 102 if self.schema!='NumSim' and self.gettable<>-1: 103 self.BURL=discoveryBASE.replace(self.schema,'NDG-B1') 104 self.BURL=self.BURL.replace(server,servicehost) 105 logging.debug("Set up stub-B url: '%s'" %self.BURL) 106 98 107 99 108 def __buildURL(self,base,queryStuff): -
exist/trunk/python/ndgUtils/ndgRetrieve.py
r3502 r4160 1 1 import DocumentRetrieve,xmlHandler2 2 2 from ndgSearch import ndgSearch 3 import cgi,time 3 import cgi,time, logging 4 5 class NDGRetrieveError(Exception): 6 """Exception handling for NDG Retrieve method.""" 7 def __init__(self, msg): 8 logging.error(msg) 9 Exception.__init__(self, msg) 10 4 11 5 12 def ndgRetrieve(uri,config,logger=0,output='',remote=0,discovery=1): … … 17 24 def getws(config,uri,remote): 18 25 ''' Get a ws connection to the local exist database ''' 26 logging.debug("Getting WS connection to eXist DB") 19 27 # The logic here is that 20 28 # this code is running on server, which supports repositories sr … … 26 34 raise ValueError, 'Invalid options to ndgRetrieve (remote AND discovery impossible)' 27 35 if discovery: 36 logging.debug("Using Discovery service") 28 37 if uri.schema in ['ISO','DIF','MDIP']: 29 38 ws=ndgSearch() 30 39 else: 31 raise ValueError,'Invalid schema (%s) with discovery option in ndgRetrieve'%uri.schema 40 raise NDGRetrieveError('Invalid schema (%s) with discovery \ 41 option in ndgRetrieve' %uri.schema) 32 42 else: 33 43 try: 34 44 r=config.get('NDG_B_SERVICE',uri.repository) 35 45 sr=config.get('DEFAULT','repository') 46 logging.debug("NDG_B_SERVICE: '%s', default repository: '%s'" %(r,sr)) 36 47 except: 37 raise ValueError,"Config file not available or incomplete"48 raise NDGRetrieveError("Config file not available or incomplete") 38 49 39 if r <> sr:50 if r <> sr: 40 51 if not remote: 41 52 return 0,'The uri [%s] is not available on [%s]'%(uri,sr) … … 43 54 try: 44 55 ps=config.get('DEFAULT','proxyServer') 56 logging.debug("Retrieving data from remote proxy server, '%s'" %ps) 57 ws = DocumentRetrieve.ndgHTTP(r,proxyServer=ps) 45 58 except: 46 raise ValueError,'Config file not available or has no [proxyServer]'47 ws=DocumentRetrieve.ndgHTTP(r,proxyServer=ps)59 raise NDGRetrieveError('Config file not available \ 60 or has no [proxyServer]') 48 61 else: 49 62 try: 50 63 er=config.get('NDG_EXIST',uri.repository) 64 pwf=config.get('NDG_EXIST','passwordFile') 65 ws=DocumentRetrieve.DocumentRetrieve(er,pwfile=pwf) 51 66 except: 52 raise ValueError,'Config file not available or has no Exist repository' 53 pwf=config.get('NDG_EXIST','passwordFile') 54 ws=DocumentRetrieve.DocumentRetrieve(er,pwfile=pwf) 67 raise NDGRetrieveError('Config file not available or has \ 68 no Exist repository') 55 69 return 1,ws 56 70 … … 63 77 elif uri.schema=='NumSim': 64 78 target='/db/NumSim' 79 elif uri.schema == 'ATOM': 80 target='/db/atoms' 81 elif uri.schema == 'ATOM-BACKUP': 82 target='/db/atoms_backup' 65 83 else: 66 84 target='/db/ndg_B_metadata' -
exist/trunk/python/ndgUtils/test_DocumentRetrieve.py
r3125 r4160 1 1 import unittest 2 2 import DocumentRetrieve 3 import logging 4 5 logging.basicConfig(level=logging.DEBUG, 6 format='%(asctime)s %(filename)s:%(lineno)d %(levelname)s %(message)s') 3 7 4 8 class TestCase(unittest.TestCase): 5 9 6 10 #### Note that test_ndgRetrieve has a lot more tests on DocumentRetrieve #### 11 VALID_REPOSITORY = "chinook.badc.rl.ac.uk" 12 VALID_PROVIDER_ID = 'badc.nerc.ac.uk' 13 MOLES_DOC_TYPE = 'NDG-B0' 14 DIF_DOC_TYPE = 'DIF' 15 DC_DOC_TYPE = 'DC' 16 ISO_DOC_TYPE = 'ISO19139' 17 NDGB1_DOC_TYPE = 'NDG-B1' 18 NDGB0_DOC_TYPE = 'NDG-B0' 19 MDIP_DOC_TYPE = 'MDIP' 20 NDGA0_DOC_TYPE = 'NDG-A0' 21 NUMSIM_DOC_TYPE = 'NumSim' 22 ATOM_DOC_TYPE = 'ATOM' 23 VALID_MOLES_DOC_ID = 'dataent_hadisst' 24 VALID_NDGA_DOC_ID = 'COAPEC_500YrRun_wholerun_annual_atmos' 25 VALID_NUMSIM_DOC_ID = 'HadGEM1_CodeBase' 26 VALID_ATOM_DOC_ID = 'dataent_11679938403412067' 27 MOLES_COLLECTION = '/db/ndg_B_metadata' 28 ATOM_COLLECTION = '/db/atoms' 29 NUMSIM_COLLECTION = '/db/NumSim' 30 NDGA0_COLLECTION = '/db/ndg_A_metadata' 31 7 32 8 33 def testHTTPget(self): … … 11 36 x=DocumentRetrieve.genericHTTP(proxyServer='http://wwwcache3.rl.ac.uk:8080/') 12 37 y=x.get(s) 38 self.assertNotEquals(y.find('Google'), -1) 13 39 14 40 def testVocabServer(self): 15 41 ''' Test the vocabServer ''' 16 42 v=DocumentRetrieve.ndgVocabPOX(proxyServer="http://wwwcache3.rl.ac.uk:8080/") 17 print v.getRelated('rain') 43 res = v.getRelated('rain') 44 self.assertEquals(res[1][0], 'rain') 45 46 def testNdgHTTP(self): 47 dr = DocumentRetrieve.ndgHTTP(self.VALID_PROVIDER_ID, \ 48 proxyServer="http://wwwcache3.rl.ac.uk:8080/") 49 doc = dr.get(self.VALID_PROVIDER_ID, \ 50 self.MOLES_DOC_TYPE, self.VALID_MOLES_DOC_ID) 51 self.assertNotEquals(doc.find(self.VALID_MOLES_DOC_ID), -1) 52 53 def testGetDIF(self): 54 dr = DocumentRetrieve.DocumentRetrieve(self.VALID_REPOSITORY) 55 doc = dr.get(self.VALID_PROVIDER_ID, self.DIF_DOC_TYPE, \ 56 self.VALID_MOLES_DOC_ID, targetCollection = self.MOLES_COLLECTION) 57 self.assertNotEquals(doc.find(self.VALID_MOLES_DOC_ID), -1) 58 59 def offtestGetMDIP(self): 60 # TODO: switch back on once the MDIP tranform has been fixed 61 dr = DocumentRetrieve.DocumentRetrieve(self.VALID_REPOSITORY) 62 doc = dr.get(self.VALID_PROVIDER_ID, self.MDIP_DOC_TYPE, \ 63 self.VALID_MOLES_DOC_ID, targetCollection = self.MOLES_COLLECTION) 64 self.assertNotEquals(doc.find(self.VALID_MOLES_DOC_ID), -1) 65 66 def testGetISO(self): 67 dr = DocumentRetrieve.DocumentRetrieve(self.VALID_REPOSITORY) 68 doc = dr.get(self.VALID_PROVIDER_ID, self.ISO_DOC_TYPE, \ 69 self.VALID_MOLES_DOC_ID, targetCollection = self.MOLES_COLLECTION) 70 self.assertNotEquals(doc.find(self.VALID_MOLES_DOC_ID), -1) 71 72 def testGetISO(self): 73 dr = DocumentRetrieve.DocumentRetrieve(self.VALID_REPOSITORY) 74 doc = dr.get(self.VALID_PROVIDER_ID, self.ISO_DOC_TYPE, \ 75 self.VALID_MOLES_DOC_ID, targetCollection = self.MOLES_COLLECTION) 76 self.assertNotEquals(doc.find(self.VALID_MOLES_DOC_ID), -1) 77 78 def testGetDC(self): 79 dr = DocumentRetrieve.DocumentRetrieve(self.VALID_REPOSITORY) 80 doc = dr.get(self.VALID_PROVIDER_ID, self.DC_DOC_TYPE, \ 81 self.VALID_MOLES_DOC_ID, targetCollection = self.MOLES_COLLECTION) 82 self.assertNotEquals(doc.find(self.VALID_MOLES_DOC_ID), -1) 83 84 def testGetNumSim(self): 85 dr = DocumentRetrieve.DocumentRetrieve(self.VALID_REPOSITORY) 86 doc = dr.get(self.VALID_PROVIDER_ID, self.NUMSIM_DOC_TYPE, \ 87 self.VALID_NUMSIM_DOC_ID, targetCollection = self.NUMSIM_COLLECTION) 88 self.assertNotEquals(doc.find(self.VALID_NUMSIM_DOC_ID), -1) 89 90 def testGetAtom(self): 91 dr = DocumentRetrieve.DocumentRetrieve(self.VALID_REPOSITORY) 92 doc = dr.get(self.VALID_PROVIDER_ID, self.ATOM_DOC_TYPE, \ 93 self.VALID_ATOM_DOC_ID, targetCollection = self.ATOM_COLLECTION) 94 self.assertNotEquals(doc.find(self.VALID_ATOM_DOC_ID), -1) 95
Note: See TracChangeset
for help on using the changeset viewer.