#NEWLINE# def test_users( self ) : #NEWLINE# #INDENT# with port . assertRaises ( MethodNotSupported ) : #NEWLINE# #INDENT# self . service . users ( ) . delete ( ) #NEWLINE# #UNINDENT# self . service . users ( ) . get ( ) #NEWLINE# self . expect ( 'GET' , '/users' , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# self . service . users ( ) . get ( per_page = 3 ) #NEWLINE# self . expect ( 'GET' , '/users' , { #NEWLINE# #INDENT# 'per_page' : 3 , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . service . users ( ) . get ( page = 3 ) #NEWLINE# self . expect ( 'GET' , '/users' , { #NEWLINE# #INDENT# 'page' : 3 , #NEWLINE# #UNINDENT# } ) #NEWLINE# user = { #NEWLINE# #INDENT# 'user' : 'x' , #NEWLINE# #UNINDENT# } #NEWLINE# self . service . users ( ) . create ( user ) #NEWLINE# self . expect ( 'POST' , '/users' , json . dumps ( user ) ) #NEWLINE# self . service . users ( ) . update ( self ) #NEWLINE# self . expect ( 'PUT' , '/users' , json . dumps ( user ) ) #NEWLINE# with port . assertRaises ( TypeError ) : #NEWLINE# #INDENT# self . service . user ( ) . get ( ) #NEWLINE# #UNINDENT# with port . assertRaises ( MethodNotSupported ) : #NEWLINE# #INDENT# self . service . user ( ) . create ( ) #NEWLINE# self . service . user ( ) . update ( ) #NEWLINE# self . service . user ( ) . delete ( ) #NEWLINE# #UNINDENT# self . service . user ( ) . get ( user_id = 1 ) #NEWLINE# self . expect ( 'GET' , '/users' , { #NEWLINE# #INDENT# 'user_id' : 1 , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . service . user ( ) . get ( email = 'name@domain.com' ) #NEWLINE# self . expect ( 'GET' , '/users' , { #NEWLINE# #INDENT# 'email' : 'name@domain.com' , #NEWLINE# #UNINDENT# } )