<s> import unittest <EOL> from libsaas . executors import test_executor <EOL> from libsaas . services import base , twilio <EOL> class TwilioTestCase ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> self . executor = test_executor . use ( ) <EOL> self . executor . set_response ( b'<STR_LIT:{}>' , <NUM_LIT:200> , { } ) <EOL> self . service = twilio . Twilio ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> self . account = self . service . account ( '<STR_LIT:foo>' ) <EOL> def expect ( self , method = None , uri = None , params = None , headers = None ) : <EOL> if method is not None : <EOL> self . assertEqual ( method , self . executor . request . method ) <EOL> if uri is not None : <EOL> self . assertEqual ( self . executor . request . uri , <EOL> '<STR_LIT>' + uri ) <EOL> if params is not None : <EOL> self . assertEqual ( self . executor . request . params , params ) <EOL> if headers is not None : <EOL> self . assertEqual ( self . executor . request . headers , headers ) <EOL> def test_translate_inequality ( self ) : <EOL> self . assertEqual ( '<STR_LIT>' , <EOL> twilio . resource . translate_inequality ( '<STR_LIT>' ) ) <EOL> self . assertEqual ( '<STR_LIT>' , <EOL> twilio . resource . translate_inequality ( '<STR_LIT>' ) ) <EOL> self . assertEqual ( '<STR_LIT>' , <EOL> twilio . resource . translate_inequality ( '<STR_LIT>' ) ) <EOL> def test_auth ( self ) : <EOL> service = twilio . Twilio ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> service . accounts ( ) . get ( ) <EOL> self . expect ( '<STR_LIT:GET>' , '<STR_LIT>' , { } , <EOL> { '<STR_LIT>' : '<STR_LIT>' } ) <EOL> def test_accounts ( self ) : <EOL> self . assertRaises ( TypeError , self . service . account ) <EOL> self . account . get ( ) <EOL> self . expect ( '<STR_LIT:GET>' , '<STR_LIT>' ) <EOL> update_account_data = { '<STR_LIT>' : '<STR_LIT>' } <EOL> self . account . update ( update_account_data ) <EOL> self . expect ( '<STR_LIT:POST>' , '<STR_LIT>' , update_account_data ) <EOL> self . assertRaises ( base . MethodNotSupported , self . account . create ) <EOL> self . assertRaises ( base . MethodNotSupported , self . account . delete ) <EOL> accounts = self . service . accounts ( ) <EOL> accounts . get ( ) <EOL> self . expect ( '<STR_LIT:GET>' , '<STR_LIT>' ) <EOL> accounts . get ( FriendlyName = '<STR_LIT>' ) <EOL> self . expect ( '<STR_LIT:GET>' , '<STR_LIT>' , { '<STR_LIT>' : '<STR_LIT>' } ) <EOL> new_account_data = { '<STR_LIT>' : '<STR_LIT:foo>' } <EOL> accounts . create ( new_account_data ) <EOL> self . expect ( '<STR_LIT:POST>' , '<STR_LIT>' , new_account_data ) <EOL> self . assertRaises ( base . MethodNotSupported , accounts . update ) <EOL> self . assertRaises ( base . MethodNotSupported , accounts . delete ) <EOL> def test_numbers ( self ) : <EOL> available_phone_numbers = self . account . available_phone_numbers ( ) <EOL> self . assertRaises ( base . MethodNotSupported , <EOL> available_phone_numbers . get ) <EOL> self . assertRaises ( base . MethodNotSupported , <EOL> available_phone_numbers . create ) <EOL> self . assertRaises ( base . MethodNotSupported , <EOL> available_phone_numbers . update ) <EOL> self . assertRaises ( base . MethodNotSupported , <EOL> available_phone_numbers . delete ) <EOL> local_us = available_phone_numbers . local ( '<STR_LIT>' ) <EOL> self . assertRaises ( TypeError , available_phone_numbers . local ) <EOL> local_us . get ( ) <EOL> self . expect ( '<STR_LIT:GET>' , '<STR_LIT>' ) <EOL> local_us . get ( Contains = '<STR_LIT>' ) <EOL> self . expect ( '<STR_LIT:GET>' , '<STR_LIT>' , <EOL> { '<STR_LIT>' : '<STR_LIT>' } ) <EOL> self . assertRaises ( base . MethodNotSupported , local_us . create ) <EOL> self . assertRaises ( base . MethodNotSupported , local_us . update ) <EOL> self . assertRaises ( base . MethodNotSupported , local_us . delete ) <EOL> toll_free_us = available_phone_numbers . toll_free ( '<STR_LIT>' ) <EOL> self . assertRaises ( TypeError , available_phone_numbers . toll_free ) <EOL> toll_free_us . get ( ) <EOL> self . expect ( '<STR_LIT:GET>' , '<STR_LIT>' ) <EOL> toll_free_us . get ( Contains = '<STR_LIT>' ) <EOL> self . expect ( '<STR_LIT:GET>' , '<STR_LIT>' , <EOL> { '<STR_LIT>' : '<STR_LIT>' } ) <EOL> self . assertRaises ( base . MethodNotSupported , toll_free_us . create ) <EOL> self . assertRaises ( base . MethodNotSupported , toll_free_us . update ) <EOL> self . assertRaises ( base . MethodNotSupported , toll_free_us . delete ) <EOL> caller_id = self . account . outgoing_caller_id ( '<STR_LIT>' ) <EOL> caller_id . get ( ) <EOL> self . expect ( '<STR_LIT:GET>' , '<STR_LIT>' ) <EOL> update_outgoing_data = { '<STR_LIT>' : '<STR_LIT:foo>' } <EOL> caller_id . update ( update_outgoing_data ) <EOL> self . expect ( '<STR_LIT:POST>' , '<STR_LIT>' , <EOL> update_outgoing_data ) <EOL> caller_id . delete ( ) <EOL> self . expect ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> self . assertRaises ( base . MethodNotSupported , caller_id . create ) <EOL> caller_ids = self . account . outgoing_caller_ids ( ) <EOL> caller_ids . get ( ) <EOL> self . expect ( '<STR_LIT:GET>' , '<STR_LIT>' ) <EOL> caller_ids . get ( FriendlyName = '<STR_LIT>' ) <EOL> self . expect ( '<STR_LIT:GET>' , '<STR_LIT>' , <EOL> { '<STR_LIT>' : '<STR_LIT>' } ) <EOL> new_outgoing_data = { '<STR_LIT>' : <NUM_LIT> , '<STR_LIT>' : <NUM_LIT> } <EOL> caller_ids . create ( new_outgoing_data ) <EOL> self . expect ( '<STR_LIT:POST>' , '<STR_LIT>' , <EOL> new_outgoing_data ) <EOL> self . assertRaises ( base . MethodNotSupported , caller_ids . update ) <EOL> self . assertRaises ( base . MethodNotSupported , caller_ids . delete ) <EOL> number = self . account . incoming_phone_number ( '<STR_LIT>' ) <EOL> number . get ( ) <EOL> self . expect ( '<STR_LIT:GET>' , '<STR_LIT>' ) <EOL> update_number_data = { '<STR_LIT>' : '<STR_LIT:foo>' } <EOL> number . update ( update_number_data ) <EOL> self . expect ( '<STR_LIT:POST>' , '<STR_LIT>' , <EOL> update_number_data ) <EOL> number . delete ( ) <EOL> self . expect ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> self . assertRaises ( base . MethodNotSupported , number . create ) <EOL> numbers = self . account . incoming_phone_numbers ( ) <EOL> numbers . get ( ) <EOL> self . expect ( '<STR_LIT:GET>' , '<STR_LIT>' ) <EOL> numbers . get ( FriendlyName = '<STR_LIT>' ) <EOL> self . expect ( '<STR_LIT:GET>' , '<STR_LIT>' , <EOL> { '<STR_LIT>' : '<STR_LIT>' } ) <EOL> new_number_data = { '<STR_LIT>' : <NUM_LIT> , '<STR_LIT>' : <NUM_LIT> } <EOL> numbers . create ( new_number_data ) <EOL> self . expect ( '<STR_LIT:POST>' , '<STR_LIT>' , <EOL> new_number_data ) <EOL> self . assertRaises ( base . MethodNotSupported , numbers . update ) <EOL> self . assertRaises ( base . MethodNotSupported , numbers . delete ) <EOL> local_numbers = self . account . incoming_phone_numbers ( ) . local ( ) <EOL> local_numbers . get ( ) <EOL> self . expect ( '<STR_LIT:GET>' , '<STR_LIT>' ) <EOL> local_numbers . get ( FriendlyName = '<STR_LIT>' ) <EOL> self . expect ( '<STR_LIT:GET>' , '<STR_LIT>' , <EOL> { '<STR_LIT>' : '<STR_LIT>' } ) <EOL> new_number_data = { '<STR_LIT>' : <NUM_LIT> } <EOL> local_numbers . create ( new_number_data ) <EOL> self . expect ( '<STR_LIT:POST>' , '<STR_LIT>' , <EOL> new_number_data ) <EOL> self . assertRaises ( base . MethodNotSupported , local_numbers . update ) <EOL> self . assertRaises ( base . MethodNotSupported , local_numbers . delete ) <EOL> toll_free_numbers = self . account . incoming_phone_numbers ( ) . toll_free ( ) <EOL> toll_free_numbers . get ( ) <EOL> self . expect ( '<STR_LIT:GET>' , '<STR_LIT>' ) <EOL> toll_free_numbers . get ( FriendlyName = '<STR_LIT>' ) <EOL> self . expect ( '<STR_LIT:GET>' , '<STR_LIT>' , <EOL> { '<STR_LIT>' : '<STR_LIT>' } ) <EOL> new_number_data = { '<STR_LIT>' : <NUM_LIT> } <EOL> toll_free_numbers . create ( new_number_data ) <EOL> self . expect ( '<STR_LIT:POST>' , '<STR_LIT>' , <EOL> new_number_data ) <EOL> self . assertRaises ( base . MethodNotSupported , toll_free_numbers . update ) <EOL> self . assertRaises ( base . MethodNotSupported , toll_free_numbers . delete ) <EOL> def test_applications ( self ) : <EOL> connect_app = self . account . connect_app ( '<STR_LIT>' ) <EOL> self . assertRaises ( TypeError , self . account . connect_app ) <EOL> connect_app . get ( ) <EOL> self . expect ( '<STR_LIT:GET>' , '<STR_LIT>' ) <EOL> update_app_data = { '<STR_LIT>' : '<STR_LIT:foo>' } <EOL> connect_app . update ( update_app_data ) <EOL> self . expect ( '<STR_LIT:POST>' , '<STR_LIT>' , <EOL> update_app_data ) <EOL> self . assertRaises ( base . MethodNotSupported , connect_app . create ) <EOL> self . assertRaises ( base . MethodNotSupported , connect_app . delete ) <EOL> connect_apps = self . account . connect_apps ( ) <EOL> connect_apps . get ( ) <EOL> self . expect ( '<STR_LIT:GET>' , '<STR_LIT>' ) <EOL> self . assertRaises ( base . MethodNotSupported , connect_apps . create ) <EOL> self . assertRaises ( base . MethodNotSupported , connect_apps . update ) <EOL> self . assertRaises ( base . MethodNotSupported , connect_apps . delete ) <EOL> authorized_connect_app = self . account . authorized_connect_app ( '<STR_LIT>' ) <EOL> self . assertRaises ( TypeError , self . account . authorized_connect_app ) <EOL> authorized_connect_app . get ( ) <EOL> self . expect ( '<STR_LIT:GET>' , '<STR_LIT>' ) <EOL> self . assertRaises ( base . MethodNotSupported , <EOL> authorized_connect_app . create ) <EOL> self . assertRaises ( base . MethodNotSupported , <EOL> authorized_connect_app . update ) <EOL> self . assertRaises ( base . MethodNotSupported , <EOL> authorized_connect_app . delete ) <EOL> authorized_connect_apps = self . account . authorized_connect_apps ( ) <EOL> authorized_connect_apps . get ( ) <EOL> self . expect ( '<STR_LIT:GET>' , '<STR_LIT>' ) <EOL> self . assertRaises ( base . MethodNotSupported , <EOL> authorized_connect_apps . create ) <EOL> self . assertRaises ( base . MethodNotSupported , <EOL> authorized_connect_apps . update ) <EOL> self . assertRaises ( base . MethodNotSupported , <EOL> authorized_connect_apps . delete ) <EOL> application = self . account . application ( '<STR_LIT>' ) <EOL> self . assertRaises ( TypeError , self . account . application ) <EOL> application . get ( ) <EOL> self . expect ( '<STR_LIT:GET>' , '<STR_LIT>' ) <EOL> update_app_data = { '<STR_LIT>' : '<STR_LIT:foo>' , '<STR_LIT>' : '<STR_LIT>' } <EOL> application . update ( update_app_data ) <EOL> self . expect ( '<STR_LIT:POST>' , '<STR_LIT>' , <EOL> update_app_data ) <EOL> application . delete ( ) <EOL> self . expect ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> self . assertRaises ( base . MethodNotSupported , application . create ) <EOL> applications = self . account . applications ( ) <EOL> applications . get ( ) <EOL> self . expect ( '<STR_LIT:GET>' , '<STR_LIT>' ) <EOL> applications . get ( FriendlyName = '<STR_LIT:foo>' ) <EOL> self . expect ( '<STR_LIT:GET>' , '<STR_LIT>' , <EOL> { '<STR_LIT>' : '<STR_LIT:foo>' } ) <EOL> new_app_data = { '<STR_LIT>' : '<STR_LIT:foo>' } <EOL> applications . create ( new_app_data ) <EOL> self . expect ( '<STR_LIT:POST>' , '<STR_LIT>' , new_app_data ) <EOL> self . assertRaises ( base . MethodNotSupported , applications . update ) <EOL> self . assertRaises ( base . MethodNotSupported , applications . delete ) <EOL> def test_calls ( self ) : <EOL> call = self . account . call ( '<STR_LIT>' ) <EOL> self . assertRaises ( TypeError , self . account . call ) <EOL> call . get ( ) <EOL> self . expect ( '<STR_LIT:GET>' , '<STR_LIT>' ) <EOL> update_call_data = { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT>' : '<STR_LIT>' } <EOL> call . update ( update_call_data ) <EOL> self . expect ( '<STR_LIT:POST>' , '<STR_LIT>' , update_call_data ) <EOL> self . assertRaises ( base . MethodNotSupported , call . create ) <EOL> self . assertRaises ( base . MethodNotSupported , call . delete ) <EOL> call_notifications = call . notifications ( ) <EOL> call_notifications . get ( ) <EOL> self . expect ( '<STR_LIT:GET>' , '<STR_LIT>' ) <EOL> call_notifications . get ( MessageDateGT = '<STR_LIT>' ) <EOL> self . expect ( '<STR_LIT:GET>' , '<STR_LIT>' , <EOL> { '<STR_LIT>' : '<STR_LIT>' } ) <EOL> self . assertRaises ( base . MethodNotSupported , call_notifications . create ) <EOL> self . assertRaises ( base . MethodNotSupported , call_notifications . update ) <EOL> self . assertRaises ( base . MethodNotSupported , call_notifications . delete ) <EOL> call_recordings = call . recordings ( ) <EOL> call_recordings . get ( ) <EOL> self . expect ( '<STR_LIT:GET>' , '<STR_LIT>' ) <EOL> call_recordings . get ( DateCreatedLT = '<STR_LIT>' ) <EOL> self . expect ( '<STR_LIT:GET>' , '<STR_LIT>' , <EOL> { '<STR_LIT>' : '<STR_LIT>' } ) <EOL> self . assertRaises ( base . MethodNotSupported , call_recordings . create ) <EOL> self . assertRaises ( base . MethodNotSupported , call_recordings . update ) <EOL> self . assertRaises ( base . MethodNotSupported , call_recordings . delete ) <EOL> calls = self . account . calls ( ) <EOL> calls . get ( ) <EOL> self . expect ( '<STR_LIT:GET>' , '<STR_LIT>' ) <EOL> calls . get ( StartTimeGT = '<STR_LIT>' ) <EOL> self . expect ( '<STR_LIT:GET>' , '<STR_LIT>' , <EOL> { '<STR_LIT>' : '<STR_LIT>' } ) <EOL> new_call_data = { '<STR_LIT>' : '<STR_LIT>' } <EOL> calls . create ( new_call_data ) <EOL> self . expect ( '<STR_LIT:POST>' , '<STR_LIT>' , new_call_data ) <EOL> self . assertRaises ( base . MethodNotSupported , calls . update ) <EOL> self . assertRaises ( base . MethodNotSupported , calls . delete ) <EOL> def test_conferences ( self ) : <EOL> conference = self . account . conference ( '<STR_LIT>' ) <EOL> self . assertRaises ( TypeError , self . account . conference ) <EOL> conference . get ( ) <EOL> self . expect ( '<STR_LIT:GET>' , '<STR_LIT>' ) <EOL> self . assertRaises ( base . MethodNotSupported , conference . create ) <EOL> self . assertRaises ( base . MethodNotSupported , conference . update ) <EOL> self . assertRaises ( base . MethodNotSupported , conference . delete ) <EOL> participant = conference . participant ( '<STR_LIT>' ) <EOL> participant . get ( ) <EOL> self . expect ( '<STR_LIT:GET>' , <EOL> '<STR_LIT>' ) <EOL> update_participant_data = { '<STR_LIT>' : True } <EOL> participant . update ( update_participant_data ) <EOL> self . expect ( '<STR_LIT:POST>' , <EOL> '<STR_LIT>' , <EOL> update_participant_data ) <EOL> participant . delete ( ) <EOL> self . expect ( '<STR_LIT>' , <EOL> '<STR_LIT>' ) <EOL> self . assertRaises ( base . MethodNotSupported , participant . create ) <EOL> participants = conference . participants ( ) <EOL> participants . get ( ) <EOL> self . expect ( '<STR_LIT:GET>' , '<STR_LIT>' ) <EOL> participants . get ( Muted = True ) <EOL> self . expect ( '<STR_LIT:GET>' , '<STR_LIT>' , <EOL> { '<STR_LIT>' : '<STR_LIT:true>' } ) <EOL> self . assertRaises ( base . MethodNotSupported , participants . create ) <EOL> self . assertRaises ( base . MethodNotSupported , participants . update ) <EOL> self . assertRaises ( base . MethodNotSupported , participants . delete ) <EOL> conferences = self . account . conferences ( ) <EOL> conferences . get ( ) <EOL> self . expect ( '<STR_LIT:GET>' , '<STR_LIT>' ) <EOL> conferences . get ( DateUpdatedGT = '<STR_LIT>' ) <EOL> self . expect ( '<STR_LIT:GET>' , '<STR_LIT>' , <EOL> { '<STR_LIT>' : '<STR_LIT>' } ) <EOL> self . assertRaises ( base . MethodNotSupported , conferences . create ) <EOL> self . assertRaises ( base . MethodNotSupported , conferences . update ) <EOL> self . assertRaises ( base . MethodNotSupported , conferences . delete ) <EOL> def test_queues ( self ) : <EOL> queue = self . account . queue ( '<STR_LIT>' ) <EOL> self . assertRaises ( TypeError , self . account . queue ) <EOL> queue . get ( ) <EOL> self . expect ( '<STR_LIT:GET>' , '<STR_LIT>' ) <EOL> update_queue_data = { '<STR_LIT>' : <NUM_LIT:16> } <EOL> queue . update ( update_queue_data ) <EOL> self . expect ( '<STR_LIT:POST>' , '<STR_LIT>' , <EOL> update_queue_data ) <EOL> queue . delete ( ) <EOL> self . expect ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> self . assertRaises ( base . MethodNotSupported , queue . create ) <EOL> member = queue . member ( '<STR_LIT>' ) <EOL> member . get ( ) <EOL> self . expect ( '<STR_LIT:GET>' , '<STR_LIT>' ) <EOL> update_member_data = { '<STR_LIT>' : '<STR_LIT>' } <EOL> member . update ( update_member_data ) <EOL> self . expect ( '<STR_LIT:POST>' , '<STR_LIT>' , <EOL> update_member_data ) <EOL> self . assertRaises ( base . MethodNotSupported , member . create ) <EOL> self . assertRaises ( base . MethodNotSupported , member . delete ) <EOL> members = queue . members ( ) <EOL> members . get ( ) <EOL> self . expect ( '<STR_LIT:GET>' , '<STR_LIT>' ) <EOL> self . assertRaises ( base . MethodNotSupported , members . create ) <EOL> self . assertRaises ( base . MethodNotSupported , members . update ) <EOL> self . assertRaises ( base . MethodNotSupported , members . delete ) <EOL> queues = self . account . queues ( ) <EOL> queues . get ( ) <EOL> self . expect ( '<STR_LIT:GET>' , '<STR_LIT>' ) <EOL> new_queue_data = { '<STR_LIT>' : '<STR_LIT:foo>' , '<STR_LIT>' : <NUM_LIT:12> } <EOL> queues . create ( new_queue_data ) <EOL> self . expect ( '<STR_LIT:POST>' , '<STR_LIT>' , new_queue_data ) <EOL> self . assertRaises ( base . MethodNotSupported , queues . update ) <EOL> self . assertRaises ( base . MethodNotSupported , queues . delete ) <EOL> def test_sms ( self ) : <EOL> sms = self . account . sms ( ) <EOL> self . assertRaises ( base . MethodNotSupported , sms . get ) <EOL> self . assertRaises ( base . MethodNotSupported , sms . create ) <EOL> self . assertRaises ( base . MethodNotSupported , sms . update ) <EOL> self . assertRaises ( base . MethodNotSupported , sms . delete ) <EOL> message = sms . message ( '<STR_LIT:message>' ) <EOL> self . assertRaises ( TypeError , sms . message ) <EOL> message . get ( ) <EOL> self . expect ( '<STR_LIT:GET>' , '<STR_LIT>' ) <EOL> self . assertRaises ( base . MethodNotSupported , message . create ) <EOL> self . assertRaises ( base . MethodNotSupported , message . update ) <EOL> self . assertRaises ( base . MethodNotSupported , message . delete ) <EOL> messages = sms . messages ( ) <EOL> messages . get ( ) <EOL> self . expect ( '<STR_LIT:GET>' , '<STR_LIT>' ) <EOL> messages . get ( DateSentLT = '<STR_LIT>' ) <EOL> self . expect ( '<STR_LIT:GET>' , '<STR_LIT>' , <EOL> { '<STR_LIT>' : '<STR_LIT>' } ) <EOL> new_message_data = { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT>' : '<STR_LIT>' } <EOL> messages . create ( new_message_data ) <EOL> self . expect ( '<STR_LIT:POST>' , '<STR_LIT>' , <EOL> new_message_data ) <EOL> self . assertRaises ( base . MethodNotSupported , messages . update ) <EOL> self . assertRaises ( base . MethodNotSupported , messages . delete ) <EOL> short_code = sms . short_code ( '<STR_LIT>' ) <EOL> self . assertRaises ( TypeError , sms . short_code ) <EOL> short_code . get ( ) <EOL> self . expect ( '<STR_LIT:GET>' , '<STR_LIT>' ) <EOL> update_code_data = { '<STR_LIT>' : '<STR_LIT:foo>' } <EOL> short_code . update ( update_code_data ) <EOL> self . expect ( '<STR_LIT:POST>' , '<STR_LIT>' , <EOL> update_code_data ) <EOL> self . assertRaises ( base . MethodNotSupported , short_code . create ) <EOL> self . assertRaises ( base . MethodNotSupported , short_code . delete ) <EOL> short_codes = sms . short_codes ( ) <EOL> short_codes . get ( ) <EOL> self . expect ( '<STR_LIT:GET>' , '<STR_LIT>' ) <EOL> short_codes . get ( ShortCode = '<STR_LIT>' ) <EOL> self . expect ( '<STR_LIT:GET>' , '<STR_LIT>' , <EOL> { '<STR_LIT>' : '<STR_LIT>' } ) <EOL> self . assertRaises ( base . MethodNotSupported , short_codes . create ) <EOL> self . assertRaises ( base . MethodNotSupported , short_codes . update ) <EOL> self . assertRaises ( base . MethodNotSupported , short_codes . delete ) <EOL> def test_recordings ( self ) : <EOL> recording = self . account . recording ( '<STR_LIT>' ) <EOL> self . assertRaises ( TypeError , self . account . recording ) <EOL> recording . get ( ) <EOL> self . expect ( '<STR_LIT:GET>' , '<STR_LIT>' ) <EOL> recording . delete ( ) <EOL> self . expect ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> self . assertRaises ( base . MethodNotSupported , recording . create ) <EOL> self . assertRaises ( base . MethodNotSupported , recording . update ) <EOL> record_trans = recording . transcriptions ( ) <EOL> record_trans . get ( ) <EOL> self . expect ( '<STR_LIT:GET>' , '<STR_LIT>' ) <EOL> self . assertRaises ( base . MethodNotSupported , record_trans . create ) <EOL> self . assertRaises ( base . MethodNotSupported , record_trans . update ) <EOL> self . assertRaises ( base . MethodNotSupported , record_trans . delete ) <EOL> recordings = self . account . recordings ( ) <EOL> recordings . get ( ) <EOL> self . expect ( '<STR_LIT:GET>' , '<STR_LIT>' ) <EOL> recordings . get ( DateCreatedGT = '<STR_LIT>' ) <EOL> self . expect ( '<STR_LIT:GET>' , '<STR_LIT>' , <EOL> { '<STR_LIT>' : '<STR_LIT>' } ) <EOL> self . assertRaises ( base . MethodNotSupported , recordings . create ) <EOL> self . assertRaises ( base . MethodNotSupported , recordings . update ) <EOL> self . assertRaises ( base . MethodNotSupported , recordings . delete ) <EOL> transcription = self . account . transcription ( '<STR_LIT>' ) <EOL> self . assertRaises ( TypeError , self . account . transcription ) <EOL> transcription . get ( ) <EOL> self . expect ( '<STR_LIT:GET>' , '<STR_LIT>' ) <EOL> self . assertRaises ( base . MethodNotSupported , transcription . create ) <EOL> self . assertRaises ( base . MethodNotSupported , transcription . update ) <EOL> self . assertRaises ( base . MethodNotSupported , transcription . delete ) <EOL> transcriptions = self . account . transcriptions ( ) <EOL> transcriptions . get ( ) <EOL> self . expect ( '<STR_LIT:GET>' , '<STR_LIT>' ) <EOL> self . assertRaises ( base . MethodNotSupported , transcriptions . create ) <EOL> self . assertRaises ( base . MethodNotSupported , transcriptions . update ) <EOL> self . assertRaises ( base . MethodNotSupported , transcriptions . delete ) <EOL> def test_notifications ( self ) : <EOL> notification = self . account . notification ( '<STR_LIT>' ) <EOL> self . assertRaises ( TypeError , self . account . notification ) <EOL> notification . get ( ) <EOL> self . expect ( '<STR_LIT:GET>' , '<STR_LIT>' ) <EOL> notification . delete ( ) <EOL> self . expect ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> self . assertRaises ( base . MethodNotSupported , notification . create ) <EOL> self . assertRaises ( base . MethodNotSupported , notification . update ) <EOL> notifications = self . account . notifications ( ) <EOL> notifications . get ( ) <EOL> self . expect ( '<STR_LIT:GET>' , '<STR_LIT>' ) <EOL> notifications . get ( MessageDateGT = '<STR_LIT>' ) <EOL> self . expect ( '<STR_LIT:GET>' , '<STR_LIT>' , <EOL> { '<STR_LIT>' : '<STR_LIT>' } ) <EOL> self . assertRaises ( base . MethodNotSupported , notifications . create ) <EOL> self . assertRaises ( base . MethodNotSupported , notifications . update ) <EOL> self . assertRaises ( base . MethodNotSupported , notifications . delete ) <EOL> def test_usage ( self ) : <EOL> usage = self . account . usage ( ) <EOL> self . assertRaises ( base . MethodNotSupported , usage . get ) <EOL> self . assertRaises ( base . MethodNotSupported , usage . create ) <EOL> self . assertRaises ( base . MethodNotSupported , usage . update ) <EOL> self . assertRaises ( base . MethodNotSupported , usage . delete ) <EOL> records = usage . records ( ) <EOL> records . get ( ) <EOL> self . expect ( '<STR_LIT:GET>' , '<STR_LIT>' ) <EOL> records . get ( Category = '<STR_LIT>' , StartDate = '<STR_LIT>' , Page = <NUM_LIT:3> ) <EOL> self . expect ( '<STR_LIT:GET>' , '<STR_LIT>' , <EOL> { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : <NUM_LIT:3> } ) <EOL> self . assertRaises ( base . MethodNotSupported , records . create ) <EOL> self . assertRaises ( base . MethodNotSupported , records . update ) <EOL> self . assertRaises ( base . MethodNotSupported , records . delete ) <EOL> subresources = [ <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> ] <EOL> for subresource in subresources : <EOL> resource = getattr ( records , subresource [ <NUM_LIT:0> ] ) ( ) <EOL> url = '<STR_LIT>' . format ( subresource [ <NUM_LIT:1> ] ) <EOL> resource . get ( ) <EOL> self . expect ( '<STR_LIT:GET>' , url ) <EOL> resource . get ( Category = '<STR_LIT>' , StartDate = '<STR_LIT>' , Page = <NUM_LIT:3> ) <EOL> self . expect ( '<STR_LIT:GET>' , url , { '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : <NUM_LIT:3> } ) <EOL> self . assertRaises ( base . MethodNotSupported , resource . create ) <EOL> self . assertRaises ( base . MethodNotSupported , resource . update ) <EOL> self . assertRaises ( base . MethodNotSupported , resource . delete ) <EOL> trigger = usage . trigger ( '<STR_LIT>' ) <EOL> self . assertRaises ( TypeError , self . account . usage ( ) . trigger ) <EOL> trigger . get ( ) <EOL> self . expect ( '<STR_LIT:GET>' , '<STR_LIT>' ) <EOL> update_trigger_data = { '<STR_LIT>' : '<STR_LIT>' } <EOL> trigger . update ( update_trigger_data ) <EOL> self . expect ( '<STR_LIT:POST>' , '<STR_LIT>' , <EOL> update_trigger_data ) <EOL> trigger . delete ( ) <EOL> self . expect ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> self . assertRaises ( base . MethodNotSupported , trigger . create ) <EOL> triggers = usage . triggers ( ) <EOL> triggers . get ( ) <EOL> self . expect ( '<STR_LIT:GET>' , '<STR_LIT>' ) <EOL> triggers . get ( UsageCategory = '<STR_LIT>' , Page = <NUM_LIT:3> ) <EOL> self . expect ( '<STR_LIT:GET>' , '<STR_LIT>' , <EOL> { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT>' : <NUM_LIT:3> } ) <EOL> new_trigger_data = { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT>' : '<STR_LIT>' } <EOL> triggers . create ( new_trigger_data ) <EOL> self . expect ( '<STR_LIT:POST>' , '<STR_LIT>' , <EOL> new_trigger_data ) <EOL> self . assertRaises ( base . MethodNotSupported , triggers . update ) <EOL> self . assertRaises ( base . MethodNotSupported , triggers . delete ) </s>
