/[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 1573 by bh, Thu Aug 7 15:41:05 2003 UTC revision 1574 by bh, Mon Aug 11 12:07:47 2003 UTC
# Line 248  class FloatComparisonMixin: Line 248  class FloatComparisonMixin:
248    
249      fp_epsilon = 1e-6      fp_epsilon = 1e-6
250      fp_inf = float('1e1000')   # FIXME: hack for infinite      fp_inf = float('1e1000')   # FIXME: hack for infinite
251        
252      def assertFloatEqual(self, test, value, epsilon = None):      def assertFloatEqual(self, test, value, epsilon = None):
253          """Assert equality of test and value with some tolerance.          """Assert equality of test and value with some tolerance.
254    
# Line 273  class FloatComparisonMixin: Line 273  class FloatComparisonMixin:
273          for i in range(len(test)):          for i in range(len(test)):
274              self.assertFloatEqual(test[i], value[i], epsilon)              self.assertFloatEqual(test[i], value[i], epsilon)
275    
276        def assertPointListEquals(self, test, value):
277            """Assert equality of two lists of lists of tuples of float
278    
279            This assertion is usually used to compare the geometry of shapes
280            as returned by a Shape object's Points() method, hence the name.
281            """
282            for i in range(len(test)):
283                self.assertEquals(len(test[i]), len(value[i]))
284                for j in range(len(test[i])):
285                    self.assertFloatSeqEqual(test[i][j], value[i][j])
286    
287    
288  class SubscriberMixin:  class SubscriberMixin:
289    
290      """Mixin class for tests for messages sent through the Connector      """Mixin class for tests for messages sent through the Connector

Legend:
Removed from v.1573  
changed lines
  Added in v.1574

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26