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