@@ -12,68 +12,34 @@ def nullFactory(*args):
12
12
return args
13
13
14
14
15
- class StackSendersTestCase (unittest .TestCase ):
15
+ class StackTestCase (unittest .TestCase ):
16
16
def test_onlyBase (self ):
17
- "stackSenders can be called with no wrappers."
18
- fac = parsley .stackSenders (nullFactory )
17
+ "stack can be called with no wrappers."
18
+ fac = parsley .stack (nullFactory )
19
19
self .assertEqual (fac ('a' ), ('a' ,))
20
20
21
21
def test_oneWrapper (self ):
22
- "stackSenders can be called with one wrapper."
23
- fac = parsley .stackSenders (wrapperFactory (0 ), nullFactory )
22
+ "stack can be called with one wrapper."
23
+ fac = parsley .stack (wrapperFactory (0 ), nullFactory )
24
24
self .assertEqual (fac ('a' ), (0 , ('a' ,)))
25
25
26
26
def test_tenWrappers (self ):
27
- "stackSenders can be called with ten wrappers."
27
+ "stack can be called with ten wrappers."
28
28
args = []
29
29
result = 'a' ,
30
30
for x in xrange (10 ):
31
31
args .append (wrapperFactory (x ))
32
32
result = 9 - x , result
33
33
args .append (nullFactory )
34
- fac = parsley .stackSenders (* args )
34
+ fac = parsley .stack (* args )
35
35
self .assertEqual (fac ('a' ), result )
36
36
37
37
def test_failsWithNoBaseSender (self ):
38
- "stackSenders does require at least the base sender factory."
39
- self .assertRaises (TypeError , parsley .stackSenders )
38
+ "stack does require at least the base factory."
39
+ self .assertRaises (TypeError , parsley .stack )
40
40
41
41
def test_senderFactoriesTakeOneArgument (self ):
42
- "The callable returned by stackSenders takes exactly one argument."
43
- fac = parsley .stackSenders (nullFactory )
42
+ "The callable returned by stack takes exactly one argument."
43
+ fac = parsley .stack (nullFactory )
44
44
self .assertRaises (TypeError , fac )
45
45
self .assertRaises (TypeError , fac , 'a' , 'b' )
46
-
47
-
48
- class StackReceiversTestCase (unittest .TestCase ):
49
- def test_onlyBase (self ):
50
- "stackReceivers can be called with no wrappers."
51
- fac = parsley .stackReceivers (nullFactory )
52
- self .assertEqual (fac ('a' , 'b' ), ('a' , 'b' ))
53
-
54
- def test_oneWrapper (self ):
55
- "stackReceivers can be called with one wrapper."
56
- fac = parsley .stackReceivers (wrapperFactory (0 ), nullFactory )
57
- self .assertEqual (fac ('a' , 'b' ), (0 , ('a' , 'b' )))
58
-
59
- def test_tenWrappers (self ):
60
- "stackReceivers can be called with ten wrappers."
61
- args = []
62
- result = 'a' , 'b'
63
- for x in xrange (10 ):
64
- args .append (wrapperFactory (x ))
65
- result = 9 - x , result
66
- args .append (nullFactory )
67
- fac = parsley .stackReceivers (* args )
68
- self .assertEqual (fac ('a' , 'b' ), result )
69
-
70
- def test_failsWithNoBaseReceiver (self ):
71
- "stackReceivers does require at least the base receiver factory."
72
- self .assertRaises (TypeError , parsley .stackReceivers )
73
-
74
- def test_receiverFactoriesTakeTwoArguments (self ):
75
- "The callable returned by stackReceivers takes exactly two arguments."
76
- fac = parsley .stackReceivers (nullFactory )
77
- self .assertRaises (TypeError , fac )
78
- self .assertRaises (TypeError , fac , 'a' )
79
- self .assertRaises (TypeError , fac , 'a' , 'b' , 'c' )
0 commit comments