include raise_for_status in unit test
This commit is contained in:
parent
eb7a1e369f
commit
e144cee104
1 changed files with 8 additions and 0 deletions
|
|
@ -1,3 +1,4 @@
|
|||
import httplib
|
||||
import mock
|
||||
import unittest
|
||||
import urlparse
|
||||
|
|
@ -55,6 +56,13 @@ class TestResponse(unittest.TestCase):
|
|||
list(self.response.iter_content())
|
||||
self.response.response.read.assert_called_once()
|
||||
|
||||
self.response.response.status = 404
|
||||
self.response.response.reason = 'Not Found'
|
||||
self.response.response.getheader.return_value = 42
|
||||
with self.assertRaises(httplib.HTTPException):
|
||||
self.response.raise_for_status()
|
||||
|
||||
|
||||
|
||||
class TestSessionPost(unittest.TestCase):
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue