Ignore:
Timestamp:
18/02/09 16:32:03 (11 years ago)
Author:
cbyrom
Message:

Add better error handling + add general keyword catcher to avoid
issues with slight differences between the search clients + extend test data and test suites - handling proxies better.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ndgCommon/trunk/ndg/common/unittests/lib/testgranulite.py

    r4970 r4997  
    77import unittest, logging 
    88from ndg.common.src.lib.granulite import granulite 
     9import ndg.common.src.clients.xmldb.abstractxmldbatomclient as ac 
    910import ndg.common.unittests.testconstants as tc 
    1011from ndg.common.unittests.testutils import testUtils as tu 
     
    5354            # firstly, create the DEs referenced in the granulite 
    5455            self.createGranuliteDEs() 
    55             atom = self.g.processGranulite() 
     56            atom = self.g.processGranulite(replaceAtom = True) 
    5657            self.assertNotEqual(None, atom) 
    57             self.assertEqual('-8.26171875', atom.minX) 
    58             self.assertEqual('-11.25', atom.minY) 
    59             self.assertEqual('-3.33984375', atom.maxX) 
    60             self.assertEqual('-17.578125', atom.maxY) 
    61  
     58            self.assertEqual(-9.140625, atom.minX) 
     59            self.assertEqual(-11.25, atom.maxY) 
     60            self.assertEqual(-3.1640625, atom.maxX) 
     61            self.assertEqual(-17.578125, atom.minY) 
     62 
     63        except Exception, e: 
     64            self.fail("An exception should not have been thrown") 
     65        finally: 
     66            if atom is not None: 
     67                self.utils.deleteDoc(atom.getFullPath()) 
     68            self.deleteGranuliteDEs() 
     69             
     70         
     71         
     72    def testDuplicateProcessGranulite(self): 
     73        atom = None 
     74        try: 
     75            # firstly, create the DEs referenced in the granulite 
     76            self.createGranuliteDEs() 
     77            atom = self.g.processGranulite(replaceAtom = False) 
     78            atom = self.g.processGranulite(replaceAtom = False, initialiseAtom = True) 
     79            self.fail("An exception should not have been thrown") 
     80 
     81        except ac.DuplicateError, de: 
     82            self.assertTrue(de.message.startswith('An atom with the specified ID')) 
    6283        except Exception, e: 
    6384            self.fail("An exception should not have been thrown") 
Note: See TracChangeset for help on using the changeset viewer.