/[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 596 by bh, Thu Apr 3 11:37:01 2003 UTC revision 904 by jonathan, Wed May 14 11:16:38 2003 UTC
# Line 181  class SubscriberMixin: Line 181  class SubscriberMixin:
181      def check_messages(self, messages):      def check_messages(self, messages):
182          """Check whether the messages received match the list messages"""          """Check whether the messages received match the list messages"""
183          self.assertEquals(messages, self.received_messages)          self.assertEquals(messages, self.received_messages)
184    
185    class FloatTestCase(unittest.TestCase):
186        """TestCase with methods for testing floating point values"""
187                                                                                                                                                            
188        fp_epsilon = 1e-6
189        fp_inf = float('1e1000')   # FIXME: hack for infinite
190                                                                                                                                                            
191        def assertFloatEqual(self, first, second, msg=None):
192            """Fail if one float is greater than the other + fp_epsilon"""
193            if abs(first) == self.fp_inf:
194                self.assertEqual(first, second, msg)
195            else:
196                self.assert_(self.fp_epsilon > abs(first - second), msg)
197    

Legend:
Removed from v.596  
changed lines
  Added in v.904

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26