Hide keyboard shortcuts

Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1#!/usr/bin/env python 

2# -*- coding: utf-8 -*- 

3""" 

4This module test Loop features 

5 

6""" 

7 

8import pytest 

9import time 

10 

11 

12import functools 

13 

14from gutools.stm import Layer, Reactor, \ 

15 STATE_INIT, STATE_READY, STATE_END,\ 

16 MERGE_ADD 

17 

18class FakeEventInjector(): 

19 """Helper class to inyect some events from time to time 

20 using a local socket as transport layer. 

21 """ 

22 

23class FakeServer(): 

24 """""" 

25 

26class FakeClient(): 

27 """""" 

28 

29@pytest.fixture 

30def reactor(): 

31 reactor = Reactor() 

32 return reactor 

33 

34 

35def test_layer_definition(reactor): 

36 """" 

37 - [ ] Load a STM definition from a file 

38 - [ ] Bind (strict=False) with a class / instance which such methods 

39 - [ ] Bind (strict=True) with a class / instance which a missing method 

40 - [ ] Bind with an external class / instance which doesn't hinherit from Layer 

41 """ 

42 

43def test_timers(reactor): 

44 """" 

45 - [ ] Test Timeout 

46 - [ ] Test Restarting Timer 

47 - [ ] Test Restarting Timer with Timeout 

48 """ 

49 

50def test_stm_sharing_same_context(reactor): 

51 """" 

52 - [ ] Stack many layers that respond to the same event buy they share the same context (STM) 

53 """ 

54 

55 

56def test_connect(): 

57 """" 

58 - [ ] xxx 

59 - [ ] xxx 

60 - [ ] xxx 

61 """ 

62 

63def test_listen(): 

64 """" 

65 - [ ] xxx 

66 - [ ] xxx 

67 - [ ] xxx 

68 """ 

69 

70def test_attaching_existing_protocol(): 

71 """ 

72 - [ ] connect to somewhere and attach a STM 

73 - [ ] seach for an existing connection 

74 - [ ] attach to existing connection 

75 """ 

76 

77 

78def test_multiples_reactors(): 

79 """" 

80 - [ ] xxx 

81 - [ ] xxx 

82 - [ ] xxx 

83 """ 

84 

85def test_serialize_app(): 

86 """" 

87 - [ ] xxx 

88 - [ ] xxx 

89 - [ ] xxx 

90 """ 

91 

92def test_register_protocols(): 

93 """" 

94 - [ ] xxx 

95 - [ ] xxx 

96 - [ ] xxx 

97 """ 

98 

99def test_foo(): 

100 """" 

101 - [ ] xxx 

102 - [ ] xxx 

103 - [ ] xxx 

104 """ 

105 

106def test_foo(): 

107 """" 

108 - [ ] xxx 

109 - [ ] xxx 

110 - [ ] xxx 

111 """ 

112 

113def test_foo(): 

114 """" 

115 - [ ] xxx 

116 - [ ] xxx 

117 - [ ] xxx 

118 """ 

119 

120def test_foo(): 

121 """" 

122 - [ ] xxx 

123 - [ ] xxx 

124 - [ ] xxx 

125 """ 

126 

127def test_foo(): 

128 """" 

129 - [ ] xxx 

130 - [ ] xxx 

131 - [ ] xxx 

132 """ 

133 

134def test_foo(): 

135 """" 

136 - [ ] xxx 

137 - [ ] xxx 

138 - [ ] xxx 

139 """ 

140 

141def test_foo(): 

142 """" 

143 - [ ] xxx 

144 - [ ] xxx 

145 - [ ] xxx 

146 """ 

147 

148def test_foo(): 

149 """" 

150 - [ ] xxx 

151 - [ ] xxx 

152 - [ ] xxx 

153 """ 

154 

155def test_foo(): 

156 """" 

157 - [ ] xxx 

158 - [ ] xxx 

159 - [ ] xxx 

160 """ 

161 

162def test_foo(): 

163 """" 

164 - [ ] xxx 

165 - [ ] xxx 

166 - [ ] xxx 

167 """ 

168 

169def test_foo(): 

170 """" 

171 - [ ] xxx 

172 - [ ] xxx 

173 - [ ] xxx 

174 """ 

175 

176def test_foo(): 

177 """" 

178 - [ ] xxx 

179 - [ ] xxx 

180 - [ ] xxx 

181 """ 

182 

183def test_foo(): 

184 """" 

185 - [ ] xxx 

186 - [ ] xxx 

187 - [ ] xxx 

188 """ 

189 

190def test_foo(): 

191 """" 

192 - [ ] xxx 

193 - [ ] xxx 

194 - [ ] xxx 

195 """ 

196 

197def test_foo(): 

198 """" 

199 - [ ] xxx 

200 - [ ] xxx 

201 - [ ] xxx 

202 """ 

203 

204def test_foo(): 

205 """" 

206 - [ ] xxx 

207 - [ ] xxx 

208 - [ ] xxx 

209 """ 

210 

211def test_foo(): 

212 """" 

213 - [ ] xxx 

214 - [ ] xxx 

215 - [ ] xxx 

216 """ 

217 

218def test_foo(): 

219 """" 

220 - [ ] xxx 

221 - [ ] xxx 

222 - [ ] xxx 

223 """ 

224