Skip to content

Commit

Permalink
fix assertWithinTolerance
Browse files Browse the repository at this point in the history
It was not actually checking anything.
  • Loading branch information
GreyAlien502 committed Jan 14, 2020
1 parent 7f4d5e3 commit ea66cf3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
3 changes: 3 additions & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,6 @@ Antonio Larrosa

Aaron Craig
github: craigthelinguist

Carlos del Castillo
github: greyalien502
12 changes: 6 additions & 6 deletions test/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,9 @@ def assertWithinRange(self, val, lower_bound, upper_bound):
def assertWithinTolerance(self, val, expected, tolerance=None,
percentage=None):
if percentage is not None:
tolerance = val * percentage
lower_bound = val - tolerance
upper_bound = val + tolerance
tolerance = expected * percentage
lower_bound = expected - tolerance
upper_bound = expected + tolerance
self.assertWithinRange(val, lower_bound, upper_bound)

def test_export_pathlib_path(self):
Expand Down Expand Up @@ -217,9 +217,9 @@ def assertWithinRange(self, val, lower_bound, upper_bound):
def assertWithinTolerance(self, val, expected, tolerance=None,
percentage=None):
if percentage is not None:
tolerance = val * percentage
lower_bound = val - tolerance
upper_bound = val + tolerance
tolerance = expected * percentage
lower_bound = expected - tolerance
upper_bound = expected + tolerance
self.assertWithinRange(val, lower_bound, upper_bound)

def test_direct_instantiation_with_bytes(self):
Expand Down

0 comments on commit ea66cf3

Please sign in to comment.