Skip to content

Commit

Permalink
More tests
Browse files Browse the repository at this point in the history
  • Loading branch information
davidbrochart committed Oct 5, 2021
1 parent 8e2ad5a commit 7f1b37d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/test_utils.py
Expand Up @@ -2,7 +2,13 @@


def test_path_param_names():
# valid paths:
assert get_path_param_names("/") == set()
assert get_path_param_names("/path/{param}") == {"param"}
assert get_path_param_names("/path1/{param1}/path2/{param2}") == {"param1", "param2"}
assert get_path_param_names("/path/{param:path}") == {"param"}
assert get_path_param_names("/path1:path2/{param}") == {"param"}
# invalid paths, but should tolerate them:
assert get_path_param_names("/path/{param:}") == {"param"}
assert get_path_param_names("/path/{param::}") == {"param"}
assert get_path_param_names("/path/{param:type1:type2}") == {"param"}

0 comments on commit 7f1b37d

Please sign in to comment.