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
afe19c28
Commit
afe19c28
authored
Aug 15, 2013
by
Aaron Hill
Browse files
Added HTTP replaying for pull requests
parent
8f1a430f
Changes
3
Hide whitespace changes
Inline
Side-by-side
requirements.txt
0 → 100644
View file @
afe19c28
httreplay
==0.1.4
setup.py
View file @
afe19c28
...
...
@@ -2,6 +2,10 @@
#from distutils.core import setup
from
setuptools
import
setup
,
find_packages
from
tweepy
import
__version__
from
pip.req
import
parse_requirements
install_reqs
=
parse_requirements
(
'requirements.txt'
)
reqs
=
[
str
(
req
.
req
)
for
req
in
install_reqs
]
setup
(
name
=
"tweepy"
,
version
=
__version__
,
...
...
@@ -11,5 +15,6 @@ setup(name="tweepy",
author_email
=
"tweepy@googlegroups.com"
,
url
=
"http://github.com/tweepy/tweepy"
,
packages
=
find_packages
(),
install_requires
=
reqs
,
keywords
=
"twitter library"
,
zip_safe
=
True
)
tests/test_api.py
View file @
afe19c28
...
...
@@ -9,6 +9,9 @@ from tweepy import (API, OAuthHandler, Friendship, Cursor,
MemoryCache
,
FileCache
)
from
config
import
*
from
httreplay
import
start_replay
,
stop_replay
from
httreplay.utils
import
filter_headers_key
import
os
test_tweet_id
=
'266367358078169089'
...
...
@@ -30,12 +33,17 @@ class TweepyErrorTests(unittest.TestCase):
class
TweepyAPITests
(
unittest
.
TestCase
):
def
setUp
(
self
):
if
os
.
environ
[
'TRAVIS_SECURE_ENV_VARS'
]
==
'false'
:
start_replay
(
'records/test.json'
,
headers_key
=
filter_headers_key
([
'Authorization'
]))
auth
=
OAuthHandler
(
oauth_consumer_key
,
oauth_consumer_secret
)
auth
.
set_access_token
(
oauth_token
,
oauth_token_secret
)
self
.
api
=
API
(
auth
)
self
.
api
.
retry_count
=
2
self
.
api
.
retry_delay
=
5
def
tearDown
(
self
):
stop_replay
()
# TODO: Actually have some sort of better assertion
def
testgetoembed
(
self
):
data
=
self
.
api
.
get_oembed
(
test_tweet_id
)
...
...
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