diff options
author | Mike Burrows <mjb@asplake.co.uk> | 2009-12-26 16:33:59 +0000 |
---|---|---|
committer | Mike Burrows <mjb@asplake.co.uk> | 2009-12-26 16:33:59 +0000 |
commit | 516a748603ae6c95139040fed43f3db4cad3b499 (patch) | |
tree | 0d8de2c8d3b9b4d9aa98c547ed17c318c1d30cb7 /tests | |
parent | 3d98af90b72bc8f3a137c0229d2ea8dbf7277434 (diff) | |
download | routes-516a748603ae6c95139040fed43f3db4cad3b499.tar.gz |
add unit test for Mapper.__str__()
--HG--
branch : trunk
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_units/test_mapper_str.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/test_units/test_mapper_str.py b/tests/test_units/test_mapper_str.py new file mode 100644 index 0000000..f2a5b43 --- /dev/null +++ b/tests/test_units/test_mapper_str.py @@ -0,0 +1,18 @@ +import unittest
+from routes import Mapper
+
+class TestMapperStr(unittest.TestCase):
+ def test_str(self):
+ m = Mapper()
+ m.connect('/{controller}/{action}')
+ m.connect('entries', '/entries', controller='entry', action='index')
+ m.connect('entry', '/entries/{id}', controller='entry', action='show')
+
+ expected = """\
+Route name Methods Path
+ {controller}/{action}
+entries entries
+entry entries/{id}"""
+
+ for expected_line, actual_line in zip(expected.splitlines(), str(m).splitlines()):
+ assert expected_line == actual_line.rstrip()
|