From 80394386d07dd40474a4e2fc772e7d00c35f0e20 Mon Sep 17 00:00:00 2001 From: Alan Crosswell Date: Fri, 23 Aug 2019 14:53:53 -0400 Subject: [PATCH] demonstrate success with trailing / --- tests/schemas/test_get_path_from_regex.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/schemas/test_get_path_from_regex.py b/tests/schemas/test_get_path_from_regex.py index a006c661d..72f4c6c54 100644 --- a/tests/schemas/test_get_path_from_regex.py +++ b/tests/schemas/test_get_path_from_regex.py @@ -5,7 +5,12 @@ def test_get_path_from_regex(): Test that path from regex is correctly formatted. """ path_regex = r'^entries/(?P[^/.]+)/relationships/(?P\w+)' + path_regex_trailing = path_regex + '/' expected_path = '/entries/{pk}/relationships/{related_field}' + expected_path_trailing = expected_path + '/' enumerator = EndpointEnumerator(patterns={}) + path_trailing = enumerator.get_path_from_regex(path_regex_trailing) + assert path_trailing == expected_path_trailing + path = enumerator.get_path_from_regex(path_regex) assert path == expected_path