mirror of
https://github.com/status-im/PyGithub.git
synced 2026-09-02 11:51:10 +00:00
Implement pagination
This commit is contained in:
@@ -49,4 +49,10 @@ class TestCase( unittest.TestCase ):
|
||||
self.expect( "GET", "/test?tata=tutu&toto=titi", '{"xxx": 42}', 200, [], '{ "foo": "bar" }' )
|
||||
self.assertEqual( self.r.dataRequest( "GET", "/test", { "toto" : "titi", "tata" : "tutu" }, { "xxx" : 42 } ), { "foo" : "bar" } )
|
||||
|
||||
def testPagination( self ):
|
||||
self.expect( "GET", "/test", 'null', 200, [ ( "link", "xxx; next, xxx; last" ) ], '[ 1, 2 ]' )
|
||||
self.expect( "GET", "/test?page=2", 'null', 200, [ ( "link", "xxx; prev, xxx; first, xxx; next, xxx; last" ) ], '[ 3, 4 ]' )
|
||||
self.expect( "GET", "/test?page=3", 'null', 200, [ ( "link", "xxx; prev, xxx; first" ) ], '[ 5, 6 ]' )
|
||||
self.assertEqual( self.r.dataRequest( "GET", "/test", None, None ), [ 1, 2, 3, 4, 5, 6 ] )
|
||||
|
||||
unittest.main()
|
||||
|
||||
Reference in New Issue
Block a user