Skip to content

Commit

Permalink
rational-numbers: update tests to v1.1.0 (#1732)
Browse files Browse the repository at this point in the history
Fixes #1724
  • Loading branch information
AnAccountForReportingBugs authored and cmccandless committed Mar 25, 2019
1 parent bf0b7f2 commit a032397
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion exercises/rational-numbers/rational_numbers_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from rational_numbers import Rational


# Tests adapted from `problem-specifications//canonical-data.json` @ v1.0.0
# Tests adapted from `problem-specifications//canonical-data.json` @ v1.1.0

class RationalNumbersTest(unittest.TestCase):

Expand Down Expand Up @@ -71,9 +71,15 @@ def test_divide_by_one(self):
def test_absolute_value_of_positive(self):
self.assertEqual(abs(Rational(1, 2)), Rational(1, 2))

def test_absolute_value_of_positive_negative_numerator_denominator(self):
self.assertEqual(abs(Rational(-1, -2)), Rational(1, 2))

def test_absolute_value_of_negative(self):
self.assertEqual(abs(Rational(-1, 2)), Rational(1, 2))

def test_absolute_value_of_negative_with_negative_denominator(self):
self.assertEqual(abs(Rational(1, -2)), Rational(1, 2))

def test_absolute_value_of_zero(self):
self.assertEqual(abs(Rational(0, 1)), Rational(0, 1))

Expand Down

0 comments on commit a032397

Please sign in to comment.