ref: 8987df1a1291eb31e83dc78d877de211db145320
parent: f1771f909f6e5a5e0bcf7cf238aa51a0cbd0996a
author: Paul Brossier <piem@piem.org>
date: Sat Dec 1 10:52:12 EST 2007
tests template.py: re-ident
--- a/tests/python/template.py
+++ b/tests/python/template.py
@@ -4,15 +4,15 @@
class aubio_unit_template(unittest.TestCase):
def assertCloseEnough(self, first, second, places=5, msg=None):
- """Fail if the two objects are unequal as determined by their
- *relative* difference rounded to the given number of decimal places
- (default 7) and comparing to zero.
- """
- if round(first, places) == 0:
- if round(second-first, places) != 0:
- raise self.failureException, \
- (msg or '%r != %r within %r places' % (first, second, places))
- else:
- if round((second-first)/first, places) != 0:
- raise self.failureException, \
- (msg or '%r != %r within %r places' % (first, second, places))
+ """Fail if the two objects are unequal as determined by their
+ *relative* difference rounded to the given number of decimal places
+ (default 7) and comparing to zero.
+ """
+ if round(first, places) == 0:
+ if round(second-first, places) != 0:
+ raise self.failureException, \
+ (msg or '%r != %r within %r places' % (first, second, places))
+ else:
+ if round((second-first)/first, places) != 0:
+ raise self.failureException, \
+ (msg or '%r != %r within %r places' % (first, second, places))