#NEWLINE# def test_calendars( self ) : #NEWLINE# #INDENT# self . service . calendars ( ) . get ( ) #NEWLINE# self . expect ( 'GET' , '/calendars' , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# self . service . calendar ( '1234' ) . get ( ) #NEWLINE# self . expect ( 'GET' , '/calendars/1234' , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# obj = { #NEWLINE# #INDENT# 'foo' : 'bar' , #NEWLINE# #UNINDENT# } #NEWLINE# self . service . calendars ( ) . create ( obj ) #NEWLINE# self . expect ( 'POST' , '/calendars' , json . dumps ( obj ) ) #NEWLINE# self . service . calendar ( '1234' ) . accesses ( ) . get ( ) #NEWLINE# self . expect ( 'GET' , '/calendars/1234/accesses' , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# with port . assertRaises ( MethodNotSupported ) : #NEWLINE# #INDENT# self . service . calendar ( 1234 ) . accesses ( ) . create ( { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# with port . assertRaises ( MethodNotSupported ) : #NEWLINE# #INDENT# self . service . calendar ( 1234 ) . access ( 1234 ) . update ( { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# with port . assertRaises ( MethodNotSupported ) : #NEWLINE# #INDENT# self . service . calendar ( 1234 ) . access ( 1234 ) . delete ( { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# self . service . calendar ( 1234 ) . accesses ( ) . grant ( obj ) #NEWLINE# self . expect ( 'POST' , '/calendars/1234/accesses' , json . dumps ( self ) ) #NEWLINE# self . service . calendar ( 1234 ) . access ( 1234 ) . revoke ( ) #NEWLINE# self . expect ( 'DELETE' , '/calendars/1234/accesses/1234' , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# self . service . calendar ( '1234' ) . calendar_events ( ) . get ( ) #NEWLINE# self . expect ( 'GET' , '/calendars/1234/calendar_events' , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# self . service . calendar ( 1234 ) . calendar_events ( ) . create ( obj ) #NEWLINE# self . expect ( 'POST' , '/calendars/1234/calendar_events' , json . dumps ( obj ) ) #NEWLINE# self . service . calendar ( '1234' ) . calendar_events ( ) . past ( ) #NEWLINE# self . expect ( 'GET' , '/calendars/1234/calendar_events/past' , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# self . service . calendar ( '1234' ) . calendar_event ( 1234 ) . get ( ) #NEWLINE# self . expect ( 'GET' , '/calendars/1234/calendar_events/1234' , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# self . service . calendar ( '1234' ) . calendar_event ( 1234 ) . update ( obj ) #NEWLINE# self . expect ( 'PUT' , '/calendars/1234/calendar_events/1234' , json . dumps ( obj ) ) #NEWLINE# self . service . calendar ( '1234' ) . calendar_event ( 1234 ) . delete ( ) #NEWLINE# self . expect ( 'DELETE' , '/calendars/1234/calendar_events/1234' , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } )