Commit afe19c28 authored by Aaron Hill's avatar Aaron Hill
Browse files

Added HTTP replaying for pull requests

parent 8f1a430f
......@@ -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)
......@@ -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)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment