Ignore:
Timestamp:
02/04/07 16:24:18 (12 years ago)
Author:
lawrence
Message:

Sundry modifications to get browse working again and to use a
config file to identify the appropriate repositories (for
a given ndg uri, what repository holds the browse info? this
is by way of a temporary expedient).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TI07-MOLES/trunk/PythonCode/wsgi/ndgObject.py

    r2345 r2364  
    6363                #this is a mapping from the ndg repository id to an actual repository id 
    6464                #understood by the ndg exist interface 
    65                 repository=self.config.get('NDG_B_SERVICE',self.repository) 
     65                repository=self.config.get('NDG_B_SERVICE',self.repository,'Unknown-B-Repository') 
    6666                self.URL=self.discoveryURL.replace('ndg',repository) 
    6767                self.xmlURL=self.URL.replace('html','xml') 
     
    8686class TestCase(unittest.TestCase): 
    8787    """ Tests as required """ 
     88     
     89    def getConfig(self): 
     90        from Utilities import myConfig 
     91        config=myConfig('ndgDiscovery.config') 
     92        return config 
    8893     
    8994    def testURI1(self): 
     
    115120        n=ndgObject(uri) 
    116121        n.schema='DIF' 
    117         from Utilities import myConfig 
    118         config=myConfig('ndgDiscovery.config') 
    119         n.setConfig(config) 
     122        n.setConfig(self.getConfig()) 
    120123        if n.gettable: 
    121124            self.assertEqual(n.discoveryURL[0:5],'http:') 
    122125            print n.discoveryURL 
    123              
     126     
     127    def testStubB(self): 
     128        uri='grid.bodc.nerc.ac.uk__MOLES-B1__PCDA47973RS2302' 
     129        n=ndgObject(uri) 
     130        n.setConfig(self.getConfig()) 
     131         
     132         
    124133 
    125134if __name__=="__main__": 
Note: See TracChangeset for help on using the changeset viewer.