Commit 5f4c71fb authored by inactivist's avatar inactivist
Browse files

Merge branch 'master' of https://github.com/tweepy/tweepy into geo-models

parents 490cc6b3 cf579f04
language: python language: python
python: python:
- "2.7" - "2.7"
script: nosetests -v tests:TweepyAPITests tests:TweepyCursorTests tests:TweepyCacheTests script: nosetests -v tests:TweepyAPITests tests:TweepyCursorTests tests:TweepyCacheTests tests:TweepyErrorTests
env: env:
TWITTER_USERNAME="tweepytest" TWITTER_USERNAME="tweepytest"
CONSUMER_KEY="cjgm143dG9adHpiB4BsoQ" CONSUMER_KEY="cjgm143dG9adHpiB4BsoQ"
......
...@@ -48,9 +48,12 @@ copyright = u'2011, Joshua Roesslein' ...@@ -48,9 +48,12 @@ copyright = u'2011, Joshua Roesslein'
# built documents. # built documents.
# #
# The short X.Y version. # The short X.Y version.
version = '1.7' sys.path.insert(0, '..')
from tweepy import __version__
version = __version__
# The full version, including alpha/beta/rc tags. # The full version, including alpha/beta/rc tags.
release = '1.7' release = __version__
# The language for content autogenerated by Sphinx. Refer to documentation # The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages. # for a list of supported languages.
......
#!/usr/bin/env python #!/usr/bin/env python
#from distutils.core import setup #from distutils.core import setup
from setuptools import setup, find_packages from setuptools import setup, find_packages
from tweepy import __version__
setup(name="tweepy", setup(name="tweepy",
version="1.12", version=__version__,
description="Twitter library for python", description="Twitter library for python",
license="MIT", license="MIT",
author="Joshua Roesslein", author="Joshua Roesslein",
......
...@@ -18,6 +18,18 @@ test_tweet_id = '266367358078169089' ...@@ -18,6 +18,18 @@ test_tweet_id = '266367358078169089'
"""Unit tests""" """Unit tests"""
class TweepyErrorTests(unittest.TestCase):
def testpickle(self):
"""Verify exceptions can be pickled and unpickled."""
import pickle
from tweepy.error import TweepError
e = TweepError('no reason', {'status': 200})
e2 = pickle.loads(pickle.dumps(e))
self.assertEqual(e.reason, e2.reason)
self.assertEqual(e.response, e2.response)
class TweepyAPITests(unittest.TestCase): class TweepyAPITests(unittest.TestCase):
......
...@@ -8,6 +8,7 @@ class TweepError(Exception): ...@@ -8,6 +8,7 @@ class TweepError(Exception):
def __init__(self, reason, response=None): def __init__(self, reason, response=None):
self.reason = unicode(reason) self.reason = unicode(reason)
self.response = response self.response = response
Exception.__init__(self, reason)
def __str__(self): def __str__(self):
return self.reason return self.reason
......
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