mirror of
https://github.com/status-im/PyGithub.git
synced 2026-08-31 19:01:15 +00:00
Raise on 404 error when getting data
This commit is contained in:
@@ -3,7 +3,7 @@ import MockMockMock
|
||||
import httplib
|
||||
import base64
|
||||
|
||||
from Github import Github
|
||||
from Github import Github, UnknownGithubObject
|
||||
|
||||
class TestCase( unittest.TestCase ):
|
||||
def setUp( self ):
|
||||
@@ -40,4 +40,9 @@ class TestCase( unittest.TestCase ):
|
||||
self.expect( "GET", "/test", "null", 200, [], '{ "foo": "bar" }' )
|
||||
self.assertEqual( self.g._dataRequest( "GET", "/test", None, None ), { "foo" : "bar" } )
|
||||
|
||||
def testDataOnBadStatus( self ):
|
||||
self.expect( "GET", "/test", "null", 404, [], '{ "foo": "bar" }' )
|
||||
with self.assertRaises( UnknownGithubObject ):
|
||||
self.g._dataRequest( "GET", "/test", None, None )
|
||||
|
||||
unittest.main()
|
||||
|
||||
Reference in New Issue
Block a user