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