aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiroslav Šedivý <[email protected]>2022-11-20 20:22:48 +0100
committerMiroslav Šedivý <[email protected]>2022-11-20 20:22:48 +0100
commitf04d57acbc5ef639c0dc70fde800cf5c24d0b967 (patch)
tree7fd8ad2031c281ac2a7cbc297fb20edd2fa4152e /tests/test_streaming.py
parent762861f3447698c6954016cf003758693dcc8bcc (diff)
downloadmastodon.py-f04d57acbc5ef639c0dc70fde800cf5c24d0b967.tar.gz
refactor: use is for True/False
Diffstat (limited to 'tests/test_streaming.py')
-rw-r--r--tests/test_streaming.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/test_streaming.py b/tests/test_streaming.py
index fb60fe1..53a71ee 100644
--- a/tests/test_streaming.py
+++ b/tests/test_streaming.py
@@ -20,7 +20,7 @@ close_connections = False
20def patch_streaming(): 20def patch_streaming():
21 global streaming_is_patched 21 global streaming_is_patched
22 global close_connections 22 global close_connections
23 if streaming_is_patched == True: 23 if streaming_is_patched is True:
24 return 24 return
25 streaming_is_patched = True 25 streaming_is_patched = True
26 26
@@ -35,7 +35,7 @@ def patch_streaming():
35 response = real_connection_real_get_response(*args, **kwargs) 35 response = real_connection_real_get_response(*args, **kwargs)
36 real_body = b"" 36 real_body = b""
37 try: 37 try:
38 while close_connections == False: 38 while close_connections is False:
39 if len(select.select([response], [], [], 0.01)[0]) > 0: 39 if len(select.select([response], [], [], 0.01)[0]) > 0:
40 chunk = response.read(1) 40 chunk = response.read(1)
41 real_body += chunk 41 real_body += chunk
@@ -165,7 +165,7 @@ def test_unknown_event():
165 'data: {}', 165 'data: {}',
166 '', 166 '',
167 ]) 167 ])
168 assert listener.bla_called == True 168 assert listener.bla_called is True
169 assert listener.updates == [] 169 assert listener.updates == []
170 assert listener.notifications == [] 170 assert listener.notifications == []
171 assert listener.deletes == [] 171 assert listener.deletes == []
@@ -195,7 +195,7 @@ def test_dotted_unknown_event():
195 'data: {}', 195 'data: {}',
196 '', 196 '',
197 ]) 197 ])
198 assert listener.do_something_called == True 198 assert listener.do_something_called is True
199 assert listener.updates == [] 199 assert listener.updates == []
200 assert listener.notifications == [] 200 assert listener.notifications == []
201 assert listener.deletes == [] 201 assert listener.deletes == []
Powered by cgit v1.2.3 (git 2.41.0)