|
1 |
| -# type: ignore |
2 | 1 | from collections import OrderedDict, namedtuple
|
3 | 2 | from rx import Observable, Observer
|
4 | 3 | from rx.subjects import Subject
|
@@ -142,6 +141,7 @@ class inbox(object):
|
142 | 141 | )
|
143 | 142 | ]
|
144 | 143 |
|
| 144 | + @staticmethod |
145 | 145 | def importantEmail():
|
146 | 146 | return stream
|
147 | 147 |
|
@@ -209,10 +209,11 @@ def test_accepts_multiple_subscription_fields_defined_in_schema():
|
209 | 209 | message="Tests are good",
|
210 | 210 | unread=True,
|
211 | 211 | )
|
212 |
| - l = [] |
213 |
| - stream.subscribe(l.append) |
| 212 | + inbox = [] |
| 213 | + stream.subscribe(inbox.append) |
214 | 214 | send_important_email(email)
|
215 |
| - assert l[0][0] == email |
| 215 | + assert len(inbox) == 1 |
| 216 | + assert inbox[0][0] == email |
216 | 217 |
|
217 | 218 |
|
218 | 219 | def test_accepts_type_definition_with_sync_subscribe_function():
|
@@ -241,11 +242,11 @@ def test_accepts_type_definition_with_sync_subscribe_function():
|
241 | 242 | message="Tests are good",
|
242 | 243 | unread=True,
|
243 | 244 | )
|
244 |
| - l = [] |
245 |
| - subscription.subscribe(l.append) |
| 245 | + inbox = [] |
| 246 | + subscription.subscribe(inbox.append) |
246 | 247 | send_important_email(email)
|
247 |
| - |
248 |
| - assert l # [0].data == {'importantEmail': None} |
| 248 | + assert len(inbox) == 1 |
| 249 | + assert inbox[0].data == {"importantEmail": None} |
249 | 250 |
|
250 | 251 |
|
251 | 252 | def test_throws_an_error_if_subscribe_does_not_return_an_iterator():
|
@@ -422,6 +423,5 @@ def test_event_order_is_correct_for_multiple_publishes():
|
422 | 423 | }
|
423 | 424 |
|
424 | 425 | assert len(payload) == 2
|
425 |
| - print(payload) |
426 | 426 | assert payload[0].data == expected_payload1
|
427 | 427 | assert payload[1].data == expected_payload2
|
0 commit comments