From 1ed707312fb298e051a67c1706f429c89635ce64 Mon Sep 17 00:00:00 2001 From: Samarth D N Date: Fri, 31 Jul 2026 11:35:45 +0530 Subject: [PATCH] fix: correct typos in source and tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - proccess → process (test_decorators.py) - EXISTANCE → EXISTENCE (test_decorators.py) - wether → whether (test_routing.py) - collecton → collection (hug/store.py) - occured → occurred (hug/use.py) - fucntion → function (hug/routing.py) --- hug/routing.py | 2 +- hug/store.py | 2 +- hug/use.py | 6 +++--- tests/test_decorators.py | 6 +++--- tests/test_routing.py | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/hug/routing.py b/hug/routing.py index a5e7fccf..2cba80d4 100644 --- a/hug/routing.py +++ b/hug/routing.py @@ -83,7 +83,7 @@ def transform(self, function, **overrides): return self.where(transform=function, **overrides) def validate(self, validation_function, **overrides): - """Sets the secondary validation fucntion to use for this handler""" + """Sets the secondary validation function to use for this handler""" return self.where(validate=validation_function, **overrides) def api(self, api, **overrides): diff --git a/hug/store.py b/hug/store.py index 0f28b346..087be70f 100644 --- a/hug/store.py +++ b/hug/store.py @@ -1,6 +1,6 @@ """hug/store.py. -A collecton of native stores which can be used with, among others, the session middleware. +A collection of native stores which can be used with, among others, the session middleware. Copyright (C) 2016 Timothy Edmund Crosley diff --git a/hug/use.py b/hug/use.py index 24a3f264..bb8bbeb9 100644 --- a/hug/use.py +++ b/hug/use.py @@ -131,7 +131,7 @@ def request( if response.status_code in self.raise_on: raise requests.HTTPError( - "{0} {1} occured for url: {2}".format(response.status_code, response.reason, url) + "{0} {1} occurred for url: {2}".format(response.status_code, response.reason, url) ) return Response(data, response.status_code, response.headers) @@ -156,7 +156,7 @@ def request( if not function: if 404 in self.raise_on: - raise requests.HTTPError("404 Not Found occured for url: {0}".format(url)) + raise requests.HTTPError("404 Not Found occurred for url: {0}".format(url)) return Response("Not Found", 404, {"content-type", "application/json"}) interface = function.interface.http @@ -184,7 +184,7 @@ def request( status_code = int("".join(re.findall(r"\d+", response.status))) if status_code in self.raise_on: - raise requests.HTTPError("{0} occured for url: {1}".format(response.status, url)) + raise requests.HTTPError("{0} occurred for url: {1}".format(response.status, url)) return Response(data, status_code, response._headers) diff --git a/tests/test_decorators.py b/tests/test_decorators.py index 45e1e284..b6c89bf2 100644 --- a/tests/test_decorators.py +++ b/tests/test_decorators.py @@ -874,11 +874,11 @@ def test_middleware(): """Test to ensure the basic concept of a middleware works as expected""" @hug.request_middleware() - def proccess_data(request, response): + def process_data(request, response): request.env["SERVER_NAME"] = "Bacon" @hug.response_middleware() - def proccess_data2(request, response, resource): + def process_data2(request, response, resource): response.set_header("Bacon", "Yumm") @hug.reqresp_middleware() @@ -1387,7 +1387,7 @@ def my_static_dirs(): assert "hug" in hug.test.get(api, "/static/README.md").data assert "Index" in hug.test.get(api, "/static/tests/data").data - assert "404" in hug.test.get(api, "/static/NOT_IN_EXISTANCE.md").status + assert "404" in hug.test.get(api, "/static/NOT_IN_EXISTENCE.md").status def test_static_jailed(): diff --git a/tests/test_routing.py b/tests/test_routing.py index c492909e..88dfb5c9 100644 --- a/tests/test_routing.py +++ b/tests/test_routing.py @@ -146,7 +146,7 @@ class TestLocalRouter(TestInternalValidation): route = LocalRouter(name="cli", doc="Hi there!", transform="transform", output="output") def test_validate(self): - """Test to ensure changing wether a local route should validate or not works as expected""" + """Test to ensure changing whether a local route should validate or not works as expected""" assert "skip_validation" not in self.route.route route = self.route.validate() @@ -156,7 +156,7 @@ def test_validate(self): assert "skip_validation" in route.route def test_directives(self): - """Test to ensure changing wether a local route should supply directives or not works as expected""" + """Test to ensure changing whether a local route should supply directives or not works as expected""" assert "skip_directives" not in self.route.route route = self.route.directives()