You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@libcloud.apache.org by an...@apache.org on 2017/04/13 09:33:44 UTC
[38/46] libcloud git commit: add a unicode test for the file fixtures
add a unicode test for the file fixtures
Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/f533aa66
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/f533aa66
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/f533aa66
Branch: refs/heads/trunk
Commit: f533aa66db50937fc99a0e23a848ffc2006b6407
Parents: 6749911
Author: Anthony Shaw <an...@apache.org>
Authored: Thu Apr 13 13:29:09 2017 +1000
Committer: Anthony Shaw <an...@apache.org>
Committed: Thu Apr 13 13:29:09 2017 +1000
----------------------------------------------------------------------
libcloud/test/compute/fixtures/meta/unicode.txt | 1 +
libcloud/test/test_file_fixtures.py | 7 +++++++
2 files changed, 8 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/libcloud/blob/f533aa66/libcloud/test/compute/fixtures/meta/unicode.txt
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/meta/unicode.txt b/libcloud/test/compute/fixtures/meta/unicode.txt
new file mode 100644
index 0000000..9c3362a
--- /dev/null
+++ b/libcloud/test/compute/fixtures/meta/unicode.txt
@@ -0,0 +1 @@
+\u015a
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/libcloud/blob/f533aa66/libcloud/test/test_file_fixtures.py
----------------------------------------------------------------------
diff --git a/libcloud/test/test_file_fixtures.py b/libcloud/test/test_file_fixtures.py
index 395f315..2384e78 100644
--- a/libcloud/test/test_file_fixtures.py
+++ b/libcloud/test/test_file_fixtures.py
@@ -1,3 +1,4 @@
+# -*- coding: utf-8 -*-
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
@@ -15,6 +16,7 @@
import sys
import unittest
+from libcloud.utils.py3 import u
from libcloud.test.file_fixtures import ComputeFileFixtures
@@ -28,5 +30,10 @@ class FileFixturesTests(unittest.TestCase):
f = ComputeFileFixtures('meta')
self.assertRaises(IOError, f.load, 'nil')
+ def test_unicode(self):
+ f = ComputeFileFixtures('meta')
+ self.assertEqual(u"\u015a", f.load('unicode.txt'))
+
+
if __name__ == '__main__':
sys.exit(unittest.main())