Ignore:
Timestamp:
12/02/09 10:26:30 (11 years ago)
Author:
cbyrom
Message:

Update MILK stack to use the new ndgCommon clients suite + improve
tests by adding scaffold to do proper tidyups after tests run.

Location:
MILK/trunk/milk_server/milk_server/tests/functional
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • MILK/trunk/milk_server/milk_server/tests/functional/test_listatom.py

    r4798 r4959  
    1515from milk_server.tests import * 
    1616import logging, os 
    17 import ndg.common.src.clients.xmldb.eXist.existdbclient as dbc 
    1817import ndgutilstests.testconstants as tc 
    1918from ndgutilstests.testutils import testUtils as tu 
     
    3635     
    3736    def tearDown(self): 
    38         self.utils.dbc.deleteAtomInExist(self.createdAtom) 
     37        self.utils.ac.deleteAtom(self.createdAtom) 
    3938         
    4039     
  • MILK/trunk/milk_server/milk_server/tests/functional/test_retrieve.py

    r4487 r4959  
    1515from milk_server.tests import * 
    1616import logging 
     17import ndg.common.unittests.testconstants as tc 
     18from ndg.common.unittests.testutils import testUtils as tu 
    1719 
    18 logging.basicConfig(level=logging.DEBUG, 
    19                         format='%(asctime)s %(filename)s:%(lineno)d %(levelname)s %(message)s') 
    2020 
    2121class TestRetrieveController(TestController): 
     22 
     23    def setUp(self): 
     24        ''' 
     25        set up data used in the tests. 
     26        ''' 
     27        self.createdAtoms = []    # array to store paths to atoms created - in order to then delete them 
     28        self.utils = tu(tc.EXIST_DBCONFIG_FILE) 
     29     
    2230    def testInvalidURIIndex(self): 
    2331        try: 
     
    5159 
    5260    def testValidAtomURIIndex(self): 
     61        createdAtom = self.utils.createAtomInEXist(tc.xmlString) 
     62        self.createdAtoms.append(createdAtom.getFullPath()) 
    5363        try: 
    54             response = self.app.get(url_for(controller='browse/retrieve',uri='badc.nerc.ac.uk__ATOM__dataent_11679938403412067')) 
     64            response = self.app.get(url_for(controller='browse/retrieve',uri=tc.ndgURI)) 
    5565            self.assertEqual(response.status, 200) 
    5666        except Exception, e: 
     
    6777            print type(e) 
    6878            self.fail('An exception should not have been thrown here') 
     79 
     80    def tearDown(self): 
     81        for path  in self.createdAtoms: 
     82            # delete the test file, in case it has been used in a test 
     83            self.utils.deleteDoc(path) 
Note: See TracChangeset for help on using the changeset viewer.