Working on tests
This commit is contained in:
@@ -12,7 +12,7 @@ from vcr import VCR
|
||||
from six.moves.urllib.parse import urlparse, parse_qs
|
||||
from six.moves.BaseHTTPServer import HTTPServer
|
||||
|
||||
from rtv.oauth import OAuthHelper, OAuthHandler
|
||||
from rtv.oauth import OAuthHelper, OAuthHandler, OAuthRateLimitHandler
|
||||
from rtv.config import Config
|
||||
from rtv.packages import praw
|
||||
from rtv.terminal import Terminal
|
||||
@@ -180,9 +180,12 @@ def reddit(vcr, request):
|
||||
|
||||
with vcr.use_cassette(cassette_name):
|
||||
with patch('rtv.packages.praw.Reddit.get_access_information'):
|
||||
handler = OAuthRateLimitHandler()
|
||||
|
||||
reddit = praw.Reddit(user_agent='rtv test suite',
|
||||
decode_html_entities=False,
|
||||
disable_update_check=True)
|
||||
disable_update_check=True,
|
||||
handler=handler)
|
||||
# praw uses a global cache for requests, so we need to clear it
|
||||
# before each unit test. Otherwise we may fail to generate new
|
||||
# cassettes.
|
||||
|
||||
Reference in New Issue
Block a user