Created
April 26, 2012 19:20
-
-
Save memee/2502244 to your computer and use it in GitHub Desktop.
URLError
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@patch('urllib2.urlopen') | |
def test_api_handles_url_error(self, MockClass): | |
""" | |
usually raised where there's no connection to the host | |
system should inform enduser and admin | |
""" | |
import urllib2 | |
from imei.nokia.api import IrishGsmApi as Api | |
MockClass.return_value.side_effect = urllib2.URLError('The server couldn\'t fulfill the request.') | |
api = Api() | |
check_info = api.get_phone_info('353511021287981') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment