summaryrefslogtreecommitdiff
path: root/horizon/horizon/tests/test_data/swift_data.py
diff options
context:
space:
mode:
authorGabriel Hurley <gabriel@strikeawe.com>2012-02-23 17:10:29 -0800
committerGabriel Hurley <gabriel@strikeawe.com>2012-02-24 15:09:07 -0800
commitab35449e4c24c811ef81a3626698d40d886a1f58 (patch)
treec851fca4873ecdba3c9d8212fe9dd3532aa27ef9 /horizon/horizon/tests/test_data/swift_data.py
parent5f9f5c1784f5156b13146acd9043ebca9f4abcaf (diff)
downloadhorizon-ab35449e4c24c811ef81a3626698d40d886a1f58.tar.gz
Swift name usage cleanup. Unicode support and slash prohibition.
Ensures end-to-end support for unicode characters w/ swift in all places where cloudfiles supports it. (patch submitted to fix cloudfiles). Also makes sure that the forward-slash character is not allowed in container or object names since it's a reserved character in swift. Fixes bug 889564 and fixes bug 940689. Change-Id: I259eb04f2f8854d43d1df28876d34b237a21fa9a
Diffstat (limited to 'horizon/horizon/tests/test_data/swift_data.py')
-rw-r--r--horizon/horizon/tests/test_data/swift_data.py19
1 files changed, 14 insertions, 5 deletions
diff --git a/horizon/horizon/tests/test_data/swift_data.py b/horizon/horizon/tests/test_data/swift_data.py
index aa077d592..394f0a560 100644
--- a/horizon/horizon/tests/test_data/swift_data.py
+++ b/horizon/horizon/tests/test_data/swift_data.py
@@ -14,8 +14,11 @@
import new
+from django import http
+
from cloudfiles import container, storage_object
+from horizon.api import base
from .utils import TestDataContainer
@@ -23,21 +26,27 @@ def data(TEST):
TEST.containers = TestDataContainer()
TEST.objects = TestDataContainer()
+ request = http.HttpRequest()
+ request.user = TEST.user
+
class FakeConnection(object):
def __init__(self):
self.cdn_enabled = False
+ self.uri = base.url_for(request, "object-store")
+ self.token = TEST.token
+ self.user_agent = "python-cloudfiles"
conn = FakeConnection()
- container_1 = container.Container(conn, name="container_one")
- container_2 = container.Container(conn, name="container_two")
+ container_1 = container.Container(conn, name=u"container_one\u6346")
+ container_2 = container.Container(conn, name=u"container_two\u6346")
TEST.containers.add(container_1, container_2)
- object_dict = {"name": "test_object",
- "content_type": "text/plain",
+ object_dict = {"name": u"test_object\u6346",
+ "content_type": u"text/plain",
"bytes": 128,
"last_modified": None,
- "hash": "object_hash"}
+ "hash": u"object_hash"}
obj_dicts = [object_dict]
for obj_dict in obj_dicts:
swift_object = storage_object.Object(container_1,