Changeset 5012 for ndgCommon/trunk


Ignore:
Timestamp:
23/02/09 09:31:17 (11 years ago)
Author:
cbyrom
Message:

Various tidy ups and fixes to the test codebase - including the removal
of uneccesary files + simplify the test constants.

Location:
ndgCommon/trunk/ndg/common/unittests
Files:
2 deleted
7 edited

Legend:

Unmodified
Added
Removed
  • ndgCommon/trunk/ndg/common/unittests/clients/http/testhttpsearchclient.py

    r4990 r5012  
    2525        ''' 
    2626        set up data used in the tests. 
     27        NB, this test requires a valid MILK browse service to be available 
    2728        ''' 
    2829        self.cf = myConfig(tc.NDG_CONFIG_FILE) 
    29         proxyServer = self.cf.get('DEFAULT','proxyServer') 
     30        proxyServer = self.cf.get('DEFAULT', 'proxyServer') 
    3031        browseRepository = self.cf.get('NDG_B_SERVICE', tc.VALID_PROVIDER_ID) 
    3132        self.client = HTTPSearchClient(browseRepository,#'http://localhost:5000',  
  • ndgCommon/trunk/ndg/common/unittests/clients/xmldb/eXist/testatomclient.py

    r4997 r5012  
    2626        self.utils = tu(tc.EXIST_DBCONFIG_FILE) 
    2727         
    28  
    2928    def testInit(self): 
    3029        self.assertTrue(self.client) 
  • ndgCommon/trunk/ndg/common/unittests/dal/testndgretrieve.py

    r4988 r5012  
    5454        self.assertEqual(0, status) 
    5555         
    56     def FFtestRetrieveXMLdif(self): 
     56    def OFFtestRetrieveXMLdif(self): 
    5757        # NB, this requires a valid dif doc to be available 
    5858        ''' Make sure we can recall at least one DIF properly ''' 
  • ndgCommon/trunk/ndg/common/unittests/lib/testgranulite.py

    r5000 r5012  
    7676            atom = self.g.processGranulite(replaceAtom = False) 
    7777            atom = self.g.processGranulite(replaceAtom = False, initialiseAtom = True) 
    78             self.fail("An exception should not have been thrown") 
     78            self.fail("An exception should have been thrown") 
    7979 
    8080        except ac.DuplicateError, de: 
     
    134134        self.assertEqual(tc.GRANULITE_LOGO, self.g._atom.getLogos()[0].href) 
    135135        self.assertEquals(tc.GRANULITE_AUTHOR_NAME, self.g._atom.ME.responsibleParties[0].name) 
    136         self.assertEqual(-9.140625, atom.minX) 
    137         self.assertEqual(-11.25, atom.maxY) 
    138         self.assertEqual(-3.1640625, atom.maxX) 
    139         self.assertEqual(-17.578125, atom.minY) 
     136        self.assertEqual(-9.140625, self.g._atom.minX) 
     137        self.assertEqual(-11.25, self.g._atom.maxY) 
     138        self.assertEqual(-3.1640625, self.g._atom.maxX) 
     139        self.assertEqual(-17.578125, self.g._atom.minY) 
    140140        self.assertEqual(self.g._atom.t1, tc.GRANULITE_T1) 
    141141        self.assertEqual(self.g._atom.t2, tc.GRANULITE_T2) 
     
    145145        self._initGranule() 
    146146        self.g._extractSpatialData("POLYGON((-8.26171875 -11.25,-9.140625 -17.40234375,-3.33984375 -17.578125,-3.1640625 -12.65625,-8.26171875 -11.25))") 
    147         self.assertEqual(-9.140625, atom.minX) 
    148         self.assertEqual(-11.25, atom.maxY) 
    149         self.assertEqual(-3.1640625, atom.maxX) 
    150         self.assertEqual(-17.578125, atom.minY) 
     147        self.assertEqual(-9.140625, self.g._atom.minX) 
     148        self.assertEqual(-11.25, self.g._atom.maxY) 
     149        self.assertEqual(-3.1640625, self.g._atom.maxX) 
     150        self.assertEqual(-17.578125, self.g._atom.minY) 
    151151 
    152152 
  • ndgCommon/trunk/ndg/common/unittests/models/test_ndgObject.py

    r4991 r5012  
    6060        n.setConfig(self.config) 
    6161        self.assertTrue(n.gettable) 
    62         self.assertEqual(n.discoveryURL,'http://ndgbeta.badc.rl.ac.uk/view/badc.nerc.ac.uk__DIF__dataent_hadisst') 
     62        server=self.config.get('DISCOVERY','default') 
     63        self.assertEqual(server + '/view/badc.nerc.ac.uk__DIF__dataent_hadisst', n.discoveryURL) 
    6364           
    6465    def testStubB(self): 
     
    6667        uri=tc.VALID_PROVIDER_ID + '__' + no.NDGB1_DOC_TYPE + '__' + \ 
    6768            tc.VALID_MOLES_ID 
    68         n=no(tc.VALID_NDG_URL,self.config) 
    69         self.assertEqual(tc.VALID_DISCOVERY_URL + '?outputSchema=DIF',  
     69        n=no(tc.VALID_NDG_URL, self.config) 
     70        server=self.config.get('DISCOVERY','default') 
     71        self.assertEqual(server + tc.VALID_DISCOVERY_URL + '?outputSchema=DIF',  
    7072                         n.discoveryURL) 
    71         self.assertEqual(tc.VALID_DISCOVERY_URL, n.URL) 
    72         self.assertEqual(tc.VALID_RETRIEVE_URL + '?format=raw', n.xmlURL) 
    73         self.assertEqual(tc.VALID_DISCOVERY_URL + '?format=xml', n.printableURL) 
     73        self.assertEqual(server + tc.VALID_DISCOVERY_URL, n.URL) 
     74        self.assertEqual(server + tc.VALID_RETRIEVE_URL + '?format=raw', n.xmlURL) 
     75        self.assertEqual(server + tc.VALID_DISCOVERY_URL + '?format=xml', n.printableURL) 
    7476           
    7577    def testAtom(self): 
     
    7779        uri= tc.VALID_NDG_URL 
    7880        n=no(uri,self.config) 
    79          
    80         self.assertEqual(tc.VALID_DISCOVERY_URL + '?outputSchema=DIF', n.discoveryURL) 
    81         self.assertEqual(tc.VALID_DISCOVERY_URL, n.URL) 
    82         self.assertEqual(tc.VALID_RETRIEVE_URL + '?format=raw', n.xmlURL) 
    83         self.assertEqual(tc.VALID_DISCOVERY_URL + '?format=xml', n.printableURL) 
     81        server=self.config.get('DISCOVERY','default') 
     82        self.assertEqual(server + tc.VALID_DISCOVERY_URL + '?outputSchema=DIF', n.discoveryURL) 
     83        self.assertEqual(server + tc.VALID_DISCOVERY_URL, n.URL) 
     84        self.assertEqual(server + tc.VALID_RETRIEVE_URL + '?format=raw', n.xmlURL) 
     85        self.assertEqual(server + tc.VALID_DISCOVERY_URL + '?format=xml', n.printableURL) 
    8486           
    8587    def testPMLuri(self): 
  • ndgCommon/trunk/ndg/common/unittests/models/testatom.py

    r4944 r5012  
    223223 
    224224        atom.lookupAssociatedData(VTD.DE_TERM, sc) 
    225         self.utils.deleteDoc(atom.getFullPath()) 
    226225        self.assertFalse(atom.dataEntities) 
    227226 
     
    257256 
    258257        atom.lookupAssociatedData(VTD.DEPLOYMENT_TERM, sc) 
    259         self.utils.deleteDoc(atom.getFullPath()) 
    260258        self.assertFalse(atom.deployments) 
    261259 
     
    382380        atom.lookupAssociatedData(VTD.DE_TERM, sc, 
    383381                                  lookupIndirectReferences=True) 
    384         self.utils.deleteDoc(atom.getFullPath()) 
    385382        self.assertFalse(atom.dataEntities) 
    386383 
     
    393390        atom.lookupAssociatedData(VTD.DEPLOYMENT_TERM, sc, 
    394391                                  lookupIndirectReferences=True) 
    395         self.utils.deleteDoc(atom.getFullPath()) 
    396392        self.assertFalse(atom.deployments) 
    397393 
  • ndgCommon/trunk/ndg/common/unittests/testconstants.py

    r5000 r5012  
    1616import os, datetime 
    1717 
    18 BASE_DIR = 'unittests' 
    19  
    2018def getTestDataDir(dir): 
    2119    if os.path.exists(dir): 
     
    3937TEST_FILE_PATH = TEST_COLLECTION_PATH + '/' + TEST_FILE_NAME 
    4038 
    41 EXIST_DB = 'chinook.badc.rl.ac.uk' 
    42 #EXIST_DB = 'localhost' 
     39# this variable adjusts what eXist DB is used to run the tests against 
     40# - whilst the tests do clean up after themselves, it's probably best not to 
     41# run tests using a production environment DB! 
     42#EXIST_DB = 'chinook.badc.rl.ac.uk' 
     43EXIST_DB = 'localhost' 
    4344PG_DBCONFIG_FILE = TEST_DATA_DIR + 'pg.config' 
    4445EXIST_DBCONFIG_FILE = TEST_DATA_DIR + 'exist.config' 
     
    6970 
    7071INVALID_NDG_URL = 'badc.nerc.ac.uk__NDG-B1__dataent_hadisstBLAHH' 
    71 VALID_DISCOVERY_URL = 'http://ndgbeta.badc.rl.ac.uk/view/' + VALID_NDG_URL 
    72 VALID_RETRIEVE_URL = 'http://ndgbeta.badc.rl.ac.uk/retrieve/' + VALID_NDG_URL 
     72VALID_DISCOVERY_URL = '/view/' + VALID_NDG_URL 
     73VALID_RETRIEVE_URL = '/retrieve/' + VALID_NDG_URL 
    7374INVALID_URL = 'http://invalid.blah.com' 
    7475VALID_URL = 'http://www.google.co.uk' 
    75 VALID_DISCOVERY_URL2 = 'http://ndgbeta.badc.rl.ac.uk/view/badc.nerc.ac.uk__ATOM__famous_control_month_test_file' 
     76VALID_DISCOVERY_URL2 = '/view/badc.nerc.ac.uk__ATOM__famous_control_month_test_file' 
    7677 
    7778VALID_REPOSITORY = "chinook.badc.rl.ac.uk" 
Note: See TracChangeset for help on using the changeset viewer.