aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorOlivier Tilloy <olivier@tilloy.net>2011-07-23 07:07:31 +0000
committerOlivier Tilloy <olivier@tilloy.net>2011-07-23 07:07:31 +0000
commit81093f74b52dab98f5f0e21fd0f1067b5f097e9c (patch)
tree379553450aa46ac1184282f73f26c4d180e56e37 /test
parente012b40f63544ca086a898473f8edcc08aae1338 (diff)
downloadpyexiv2-81093f74b52dab98f5f0e21fd0f1067b5f097e9c.tar.gz
Added unit tests for Rational.__repr__().
Diffstat (limited to 'test')
-rw-r--r--test/rational.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/rational.py b/test/rational.py
index bff8e5f..bc49e9f 100644
--- a/test/rational.py
+++ b/test/rational.py
@@ -76,6 +76,11 @@ class TestRational(unittest.TestCase):
self.assertEqual(str(Rational(3, 5)), '3/5')
self.assertEqual(str(Rational(-3, 5)), '-3/5')
+ def test_repr(self):
+ self.assertEqual(repr(Rational(3, 5)), 'Rational(3, 5)')
+ self.assertEqual(repr(Rational(-3, 5)), 'Rational(-3, 5)')
+ self.assertEqual(repr(Rational(0, 3)), 'Rational(0, 3)')
+
def test_to_float(self):
self.assertEqual(Rational(3, 6).to_float(), 0.5)
self.assertEqual(Rational(11, 11).to_float(), 1.0)