示例#1
0
class TestArrayBoomNative(TransformTest):
	transform = Array(cast=lambda a: 1/0).native
	invalid = ('', )
示例#2
0
class TestArrayBoomForeign(TransformTest):
	transform = Array(separator=27).foreign
	invalid = ([], )
示例#3
0
class TestArrayNoSepForeign(TransformTest):
	transform = Array(separator=None).foreign
	valid = ((TWO, 'foo bar'), (THREE, 'foo bar'))
示例#4
0
class TestArrayCast(TransformTest):
	transform = Array(cast=tuple).native
	valid = zip(ARRAYS, (tuple(), tuple(), ('0', '1', '2', '3'), TTWO, TTWO, TTWO, TTWO))
示例#5
0
class TestArrayNoSepNative(TransformTest):
	transform = Array(separator=None).native
	valid = (('foo bar', TWO), ('foo  bar', TWO))
示例#6
0
class TestArrayNoStrip(TransformTest):
	transform = Array(strip=False).native
	valid = (('foo, bar', TWO), ('foo , bar', LSPC), ('foo,  bar', RSPC))
示例#7
0
class TestArraySeparatorNative(TransformTest):
	transform = Array(separator='|').native
	valid = [(i, TWO) for i in ('foo|bar', 'foo |bar', 'foo||bar')]
示例#8
0
class TestArrayEmptyForeign(TransformTest):
	transform = Array(empty=True).foreign
	valid = [(i, PAK) for i in (TWO, LSPC, RSPC)] + [(THREE, 'foo,,bar'), ]
示例#9
0
class TestArrayEmptyNative(TransformTest):
	transform = Array(empty=True).native
	valid = zip(ARRAYS, ([], [], ['0', '1', '', '2', '3'], TWO, TWO, THREE, TWO))