def test_match_url_path_callback(path): regex = re.compile("^/(?P<path>mozilla-(central|unified))(/|$)") m = regex.match(path) assert utils.match_url_path_callback(m) == "mozilla-central"