/[escript]/trunk/downunder/test/python/run_mappings.py
ViewVC logotype

Diff of /trunk/downunder/test/python/run_mappings.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3950 by caltinay, Fri Aug 24 02:37:47 2012 UTC revision 3951 by caltinay, Tue Aug 28 23:58:08 2012 UTC
# Line 29  class TestScalingMapping(unittest.TestCa Line 29  class TestScalingMapping(unittest.TestCa
29          self.mapping=ScalingMapping(self.alpha)          self.mapping=ScalingMapping(self.alpha)
30    
31      def test_invalid_alpha(self):      def test_invalid_alpha(self):
32          with self.assertRaises(ValueError):          self.assertRaises(ValueError, ScalingMapping, 0)
             m=ScalingMapping(0)  
33    
34      def test_value(self):      def test_value(self):
35          v=self.mapping.getValue(1.23)          v=self.mapping.getValue(1.23)
# Line 53  class TestBoundedRangeMapping(unittest.T Line 52  class TestBoundedRangeMapping(unittest.T
52          self.mapping=BoundedRangeMapping(1.5, 3.5)          self.mapping=BoundedRangeMapping(1.5, 3.5)
53    
54      def test_invalid_range(self):      def test_invalid_range(self):
55          with self.assertRaises(ValueError):          self.assertRaises(ValueError, BoundedRangeMapping, 1, 0)
             m=BoundedRangeMapping(1, 0)  
56    
57      def test_min_value(self):      def test_min_value(self):
58          v=self.mapping.getValue(-10000)          v=self.mapping.getValue(-10000)
# Line 87  class TestBoundedRangeMapping(unittest.T Line 85  class TestBoundedRangeMapping(unittest.T
85          self.assertAlmostEqual(v, ref)          self.assertAlmostEqual(v, ref)
86    
87      def test_inverse_toolow(self):      def test_inverse_toolow(self):
88          with self.assertRaises(ValueError):          self.assertRaises(ValueError, self.mapping.getInverse, 1.5)
             v=self.mapping.getInverse(1.5)  
89    
90      def test_inverse_toohigh(self):      def test_inverse_toohigh(self):
91          with self.assertRaises(ValueError):          self.assertRaises(ValueError, self.mapping.getInverse, 3.5)
             v=self.mapping.getInverse(3.5)  
92    
93      def test_inverse(self):      def test_inverse(self):
94          v=self.mapping.getInverse(2.5)          v=self.mapping.getInverse(2.5)

Legend:
Removed from v.3950  
changed lines
  Added in v.3951

  ViewVC Help
Powered by ViewVC 1.1.26