diff --git a/application/core/filters.py b/application/core/filters.py index b3caef90..a2e23117 100644 --- a/application/core/filters.py +++ b/application/core/filters.py @@ -193,7 +193,7 @@ def uri_encode(uri_template, kwarg_list): # TODO Non pythonic naming syntax # Takes a URI and appends a specified parameter to it -def appendUriParam(uri, param): +def append_uri_param(uri, param): uri_parts = list(urlparse.urlparse(uri)) query = dict(urlparse.parse_qsl(uri_parts[4])) query.update(param) @@ -221,7 +221,7 @@ def hash_file(filename): def cacheBust(uri): filename = uri.split("?")[0] sha = hash_file(filename) - return appendUriParam(uri, {"v": sha}) + return append_uri_param(uri, {"v": sha}) def extract_component_key(json_ref): diff --git a/tests/unit/core/test_filters.py b/tests/unit/core/test_filters.py index 40acae4a..38d96427 100644 --- a/tests/unit/core/test_filters.py +++ b/tests/unit/core/test_filters.py @@ -4,7 +4,7 @@ remove_values_from_param_dict, make_url_param_str, cacheBust, - appendUriParam, + append_uri_param, hash_file, ) @@ -102,15 +102,15 @@ def test_cacheBust_params(): assert len(hash) == 40 -def test_appendUriParam(): +def test_append_uri_param(): uri = "static/javascript/myCookScript.js" param = {"key": "value"} - result = appendUriParam(uri, param) + result = append_uri_param(uri, param) assert result == "static/javascript/myCookScript.js?key=value" uri = "static/javascript/myCookScript.js?key=value" param = {"differentKey": "differentValue"} - result = appendUriParam(uri, param) + result = append_uri_param(uri, param) assert ( result == "static/javascript/myCookScript.js?key=value&differentKey=differentValue"