Changeset 319 for trunk/sandbox/jhb/oc2/transports.py
- Timestamp:
- 05/23/09 02:06:34 (3 years ago)
- Files:
-
- 1 modified
-
trunk/sandbox/jhb/oc2/transports.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/sandbox/jhb/oc2/transports.py
r301 r319 65 65 return response 66 66 67 class TestTransport(object): 67 68 69 def __init__(self, *args): 70 self.results = list(args) 71 72 def __call__(self,message): 73 result = self.results.pop(0) 74 75 if type(result) == type([]) or type(result) == type(()): 76 method = result[0] 77 args = list(result[1:]) 78 args.append(message) 79 return method(*args) 80 81 elif callable(result): 82 return result(message) 83 84 else: 85 return result 86
