Implement Resource Item Not Found
This commit is contained in:
@@ -185,6 +185,8 @@ async def get_field(request):
|
||||
content = await connection.get(field)
|
||||
except ValueError:
|
||||
return web.Response(status=400, reason="Invalid Resource Path")
|
||||
except KeyError:
|
||||
return web.Response(status=204, reason="Resource Item Not Found")
|
||||
|
||||
if isinstance(content, StreamReader):
|
||||
response = web.StreamResponse(status=200, reason="OK")
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
@wip
|
||||
Feature: Fail to retrieve nonexistent resource items in Kapow! server.
|
||||
If trying to access a nonexistent resource item
|
||||
then the server responds with a no content error.
|
||||
@@ -11,6 +12,6 @@ Feature: Fail to retrieve nonexistent resource items in Kapow! server.
|
||||
| method | url_pattern |
|
||||
| GET | /listRootDir |
|
||||
When I send a request to the testing route "/listRootDir"
|
||||
And I get the resource "request/params/meloinvento"
|
||||
And I get the resource "/request/params/meloinvento"
|
||||
Then I get 204 as response code
|
||||
And I get "Resource Item Not Found" as response reason phrase
|
||||
|
||||
Reference in New Issue
Block a user