Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion hug/routing.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion hug/store.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down
6 changes: 3 additions & 3 deletions hug/use.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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"})
Comment on lines 158 to 160

interface = function.interface.http
Expand Down Expand Up @@ -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)

Expand Down
6 changes: 3 additions & 3 deletions tests/test_decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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():
Expand Down
4 changes: 2 additions & 2 deletions tests/test_routing.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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()
Expand Down