| 220 | |
| 221 | |
| 222 | def test_strict_slashes_leaves_dont_consume(): |
| 223 | # See issue #1074 |
| 224 | map = r.Map( |
| 225 | [ |
| 226 | r.Rule("/path1", endpoint="leaf"), |
| 227 | r.Rule("/path1/", endpoint="branch"), |
| 228 | r.Rule("/path2", endpoint="leaf", strict_slashes=False), |
| 229 | r.Rule("/path2/", endpoint="branch"), |
| 230 | r.Rule("/path3", endpoint="leaf"), |
| 231 | r.Rule("/path3/", endpoint="branch", strict_slashes=False), |
| 232 | r.Rule("/path4", endpoint="leaf", strict_slashes=False), |
| 233 | r.Rule("/path4/", endpoint="branch", strict_slashes=False), |
| 234 | r.Rule("/path5", endpoint="leaf"), |
| 235 | ], |
| 236 | strict_slashes=False, |
| 237 | ) |
| 238 | |
| 239 | adapter = map.bind("example.org", "/") |
| 240 | |
| 241 | assert adapter.match("/path1", method="GET") == ("leaf", {}) |
| 242 | assert adapter.match("/path1/", method="GET") == ("branch", {}) |
| 243 | assert adapter.match("/path2", method="GET") == ("leaf", {}) |
| 244 | assert adapter.match("/path2/", method="GET") == ("branch", {}) |
| 245 | assert adapter.match("/path3", method="GET") == ("leaf", {}) |
| 246 | assert adapter.match("/path3/", method="GET") == ("branch", {}) |
| 247 | assert adapter.match("/path4", method="GET") == ("leaf", {}) |
| 248 | assert adapter.match("/path4/", method="GET") == ("branch", {}) |
| 249 | assert adapter.match("/path5/", method="GET") == ("leaf", {}) |
| 250 | |
| 251 | |
| 252 | def test_environ_defaults(): |