@@ -18,11 +18,11 @@ def test_queue (self):
18
18
channel = self .exp .get_channel (self .generate_name ())
19
19
listener = channel .listen ('m' , max_age = 1 )
20
20
channel .broadcast ('m' , 1 )
21
+ time .sleep (.1 )
21
22
channel .broadcast ('m' , 2 )
22
23
time .sleep (2 )
23
24
channel .broadcast ('m' , 3 )
24
25
channel .broadcast ('m' , 4 )
25
- time .sleep (.5 )
26
26
if not listener .wait (2 ).payload in [3 , 4 ]:
27
27
raise Exception
28
28
if not listener .wait (2 ).payload in [3 , 4 ]:
@@ -31,6 +31,18 @@ def test_queue (self):
31
31
raise Exception
32
32
33
33
34
+ def test_cloning (self ):
35
+ channel = self .exp .get_channel (self .generate_name ())
36
+ listener1 = channel .listen ('hi' )
37
+ listener2 = channel .listen ('hi' );
38
+ channel .broadcast ('hi' , {});
39
+
40
+ broadcast = listener1 .wait (5 )
41
+ broadcast .payload ['a' ] = 1
42
+ broadcast2 = listener2 .wait (5 )
43
+ if 'a' in broadcast .payload and broadcast .payload ['a' ] == 1 :
44
+ raise Exception
45
+
34
46
35
47
36
48
class Test2 (utils .Base ):
@@ -80,16 +92,3 @@ def test_listener_timeout (self):
80
92
return
81
93
raise Exception
82
94
83
- def test_cloning (self ):
84
- self .consumer_credentials ['enable_network' ] = True
85
- exp = self .exp_sdk .start (** self .consumer_credentials )
86
- channel = exp .get_channel ('hi' , consumer = True );
87
- listener1 = channel .listen ('hi' )
88
- listener2 = channel .listen ('hi' );
89
- channel .broadcast ('hi' , {});
90
-
91
- broadcast = listener1 .wait (5 )
92
- broadcast .payload ['a' ] = 1
93
- broadcast2 = listener2 .wait (5 )
94
- if 'a' in broadcast .payload and broadcast .payload ['a' ] == 1 :
95
- raise Exception
0 commit comments