Skip to content

Commit

Permalink
fix for the test
Browse files Browse the repository at this point in the history
  • Loading branch information
glyph committed Sep 19, 2014
1 parent db6d131 commit 523c346
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
20 changes: 12 additions & 8 deletions mimic/rest/swift_api.py
Expand Up @@ -17,6 +17,7 @@
from mimic.catalog import Entry
from mimic.catalog import Endpoint
from mimic.rest.mimicapp import MimicApp
from twisted.web.resource import NoResource
from zope.interface import implementer


Expand Down Expand Up @@ -137,11 +138,14 @@ def get_container(self, request, container_name):
Api call to get a container, given the name of the container. HTTP
status code of 200 when such a container exists, 404 if not.
"""
request.responseHeaders.setRawHeaders("content-type",
["application/json"])
request.responseHeaders.setRawHeaders("x-container-object-count",
["0"])
request.responseHeaders.setRawHeaders("x-container-bytes-used",
["0"])
request.setResponseCode(OK)
return dumps([])
if container_name in self.containers:
request.responseHeaders.setRawHeaders("content-type",
["application/json"])
request.responseHeaders.setRawHeaders("x-container-object-count",
["0"])
request.responseHeaders.setRawHeaders("x-container-bytes-used",
["0"])
request.setResponseCode(OK)
return dumps([])
else:
return NoResource()
4 changes: 2 additions & 2 deletions mimic/test/test_swift.py
Expand Up @@ -114,11 +114,11 @@ def test_get_no_container(self):
self.assertEqual(container_response.code, 404)
self.assertEqual(
container_response.headers.getRawHeaders(
"X-Container-Object-Count"), []
"X-Container-Object-Count"), None
)
self.assertEqual(
container_response.headers.getRawHeaders(
"X-Container-Bytes-Used"), []
"X-Container-Bytes-Used"), None
)


0 comments on commit 523c346

Please sign in to comment.