Contents of /trunk/escriptcore/test/python/test_condEval.py

Revision 4938 - (show annotations)
Wed May 14 01:13:23 2014 UTC (5 years, 3 months ago) by jfenwick
File MIME type: text/x-python
File size: 6375 byte(s)
```Modify unit tests to read their classes from
esys.escriptcore.utestselect

Change the line in that file to switch between unittest and unittest2

```
 1 2 ############################################################################## 3 # 4 # Copyright (c) 2010-2014 by University of Queensland 5 6 # 7 # Primary Business: Queensland, Australia 8 # Licensed under the Open Software License version 3.0 9 10 # 11 # Development until 2012 by Earth Systems Science Computational Center (ESSCC) 12 # Development 2012-2013 by School of Earth Sciences 13 # Development from 2014 by Centre for Geoscience Computing (GeoComp) 14 # 15 ############################################################################## 16 17 __copyright__="""Copyright (c) 2010-2014 by University of Queensland 18 http://www.uq.edu.au 19 Primary Business: Queensland, Australia""" 20 __license__="""Licensed under the Open Software License version 3.0 21 22 __url__= 23 24 __author__="Joel Fenwick, joelfenwick@uq.edu.au" 25 26 import esys.escriptcore.utestselect as unittest 27 import os 28 import numpy 29 import sys 30 from esys.escript import * 31 32 class Test_CondEval(unittest.TestCase): 33 RES_TOL=1.e-7 # RES_TOLerance to compare results 34 r=getTestDomainFunctionSpace(3,3) 35 x=r.getDomain().getX() 36 37 def test_Constant(self): 38 d1=Data((1,3),self.x.getFunctionSpace()) 39 d2=Data((2,4),self.x.getFunctionSpace()) 40 m1=Data(1,self.x.getFunctionSpace()) 41 mm1=Data(-1,self.x.getFunctionSpace()) 42 self.assertTrue(Lsup(condEval(m1,d1,d2)-(1,3))