/[thuban]/branches/WIP-pyshapelib-bramz/test/support.py
ViewVC logotype

Diff of /branches/WIP-pyshapelib-bramz/test/support.py

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

revision 324 by bh, Fri Sep 20 13:55:42 2002 UTC revision 342 by bh, Fri Oct 18 17:28:46 2002 UTC
# Line 102  class FloatComparisonMixin: Line 102  class FloatComparisonMixin:
102          Assert that the absolute difference between test and value is          Assert that the absolute difference between test and value is
103          less than self.fp_epsilon.          less than self.fp_epsilon.
104          """          """
105          return self.assert_(self.fp_epsilon > abs(test - value))          self.assert_(self.fp_epsilon > abs(test - value),
106                         "abs(%g - %g) >= %g" % (test, value, self.fp_epsilon))
107    
108      def assertFloatSeqEqual(self, test, value, epsilon = None):      def assertFloatSeqEqual(self, test, value, epsilon = None):
109          """Assert equality of the sequences test and value with some tolerance.          """Assert equality of the sequences test and value with some tolerance.
# Line 114  class FloatComparisonMixin: Line 115  class FloatComparisonMixin:
115          if epsilon is None:          if epsilon is None:
116              epsilon = self.fp_epsilon              epsilon = self.fp_epsilon
117          for i in range(len(test)):          for i in range(len(test)):
118              return self.assert_(epsilon > abs(test[i] - value[i]))              self.assert_(epsilon > abs(test[i] - value[i]),
119                             "abs(%g - %g) >= %g" % (test[i], value[i], epsilon))
120    
121    
122  class SubscriberMixin:  class SubscriberMixin:

Legend:
Removed from v.324  
changed lines
  Added in v.342

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26