Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Zahra Rajabi
tweepy
Commits
848fdd3c
Unverified
Commit
848fdd3c
authored
Nov 05, 2016
by
Aaron Hill
Browse files
Update streaming tests
parent
37e318be
Changes
1
Hide whitespace changes
Inline
Side-by-side
tests/test_streaming.py
View file @
848fdd3c
...
...
@@ -109,7 +109,7 @@ class TweepyStreamTests(unittest.TestCase):
s
.
filter
(
track
=
[
u
'Caf
\xe9
'
])
# Should be UTF-8 encoded
self
.
assertEqual
(
u
'Caf
\xe9
'
.
encode
(
'utf8'
),
s
.
session
.
params
[
'track'
])
self
.
assertEqual
(
u
'Caf
\xe9
'
.
encode
(
'utf8'
),
s
.
body
[
'track'
])
def
test_follow_encoding
(
self
):
s
=
Stream
(
None
,
None
)
...
...
@@ -117,7 +117,7 @@ class TweepyStreamTests(unittest.TestCase):
s
.
filter
(
follow
=
[
u
'Caf
\xe9
'
])
# Should be UTF-8 encoded
self
.
assertEqual
(
u
'Caf
\xe9
'
.
encode
(
'utf8'
),
s
.
session
.
params
[
'follow'
])
self
.
assertEqual
(
u
'Caf
\xe9
'
.
encode
(
'utf8'
),
s
.
body
[
'follow'
])
class
TweepyStreamReadBufferTests
(
unittest
.
TestCase
):
...
...
@@ -212,9 +212,9 @@ class TweepyStreamBackoffTests(unittest.TestCase):
self
.
assertEqual
(
self
.
stream
.
retry_time
,
3.0
)
mock_resp
=
MagicMock
()
mock_resp
.
return_value
.
status
=
420
mock_resp
.
return_value
.
status
_code
=
420
@
patch
(
getresponse_location
,
mock_resp
)
@
patch
(
'requests.Session.request'
,
mock_resp
)
def
test_420
(
self
):
self
.
stream
=
Stream
(
self
.
auth
,
self
.
listener
,
timeout
=
3.0
,
retry_count
=
0
,
retry_time
=
1.0
,
retry_420
=
1.5
,
retry_time_cap
=
20.0
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment