Skip to content

Commit ce2a1af

Browse files
author
Greg Turnquist
committed
Added more tests to checkout YamlConfig.
1 parent 5150b01 commit ce2a1af

10 files changed

+96
-1
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
objects:
2+
- object: string_holder_1
3+
class: springpythontest.support.testSupportClasses.StringHolder
4+
properties:
5+
str: العربية
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
objects:
2+
- object: foo
3+
class: springpythontest.support.testSupportClasses.StringHolder
4+
properties:
5+
العربية: foo
6+
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
objects:
2+
- object: العربية
3+
class: springpythontest.support.testSupportClasses.StringHolder
4+
properties:
5+
str: foo
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
objects:
2+
- object: user_details_service
3+
class: springpython.security.userdetails.InMemoryUserDetailsService
4+
properties:
5+
user_dict:
6+
العربية: foo
7+
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
objects:
2+
- object: user_details_service
3+
class: springpython.security.userdetails.InMemoryUserDetailsService
4+
properties:
5+
user_dict:
6+
foo:
7+
tuple:
8+
- العربية
9+
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
objects:
2+
- object: user_details_service
3+
class: springpython.security.userdetails.InMemoryUserDetailsService
4+
properties:
5+
user_dict:
6+
- set:
7+
العربية
8+
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
objects:
2+
- object: user_details_service
3+
class: springpython.security.userdetails.InMemoryUserDetailsService
4+
properties:
5+
user_dict:
6+
- frozenset:
7+
العربية
8+
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
objects:
2+
- object: user_details_service
3+
class: springpython.security.userdetails.InMemoryUserDetailsService
4+
properties:
5+
user_dict:
6+
- العربية
7+
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
objects:
2+
- object: user_details_service
3+
class: springpython.security.userdetails.InMemoryUserDetailsService
4+
properties:
5+
user_dict:
6+
foo: العربية
7+

test/springpythontest/unicodeTestCases.py

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from springpython.context import *
33
from springpython.config import *
44

5-
class UnicodeTestCase(unittest.TestCase):
5+
class UnicodeTestCaseXml(unittest.TestCase):
66
def testParsingAppContextWithNonAscii1(self):
77
ctx = ApplicationContext(XMLConfig("support/unicodeContext1.xml"))
88

@@ -36,3 +36,36 @@ def testParsingAppContextWithNonAscii10(self):
3636
self.fail("Expected an encoding error since Python code is ASCII based.")
3737
except UnicodeEncodeError:
3838
pass
39+
40+
class UnicodeTestCaseYaml(unittest.TestCase):
41+
def testParsingAppContextWithNonAscii1(self):
42+
ctx = ApplicationContext(YamlConfig("support/unicodeContext1.yaml"))
43+
44+
def testParsingAppContextWithNonAscii3(self):
45+
ctx = ApplicationContext(YamlConfig("support/unicodeContext3.yaml"))
46+
47+
def testParsingAppContextWithNonAscii4(self):
48+
ctx = ApplicationContext(YamlConfig("support/unicodeContext4.yaml"))
49+
50+
def testParsingAppContextWithNonAscii5(self):
51+
ctx = ApplicationContext(YamlConfig("support/unicodeContext5.yaml"))
52+
53+
54+
def testParsingAppContextWithNonAscii6(self):
55+
ctx = ApplicationContext(YamlConfig("support/unicodeContext6.yaml"))
56+
57+
def testParsingAppContextWithNonAscii7(self):
58+
ctx = ApplicationContext(YamlConfig("support/unicodeContext7.yaml"))
59+
60+
def testParsingAppContextWithNonAscii8(self):
61+
ctx = ApplicationContext(YamlConfig("support/unicodeContext8.yaml"))
62+
63+
def testParsingAppContextWithNonAscii9(self):
64+
ctx = ApplicationContext(YamlConfig("support/unicodeContext9.yaml"))
65+
66+
def testParsingAppContextWithNonAscii10(self):
67+
try:
68+
ctx = ApplicationContext(YamlConfig("support/unicodeContext10.yaml"))
69+
self.fail("Expected an encoding error since Python code is ASCII based.")
70+
except UnicodeEncodeError:
71+
pass

0 commit comments

Comments
 (0)