<s> from O365 import event <EOL> import unittest <EOL> import json <EOL> import time <EOL> class Calendar : <EOL> '''<STR_LIT>''' <EOL> def __init__ ( self , json , auth ) : <EOL> self . json = json <EOL> self . auth = auth <EOL> self . calendarId = json [ '<STR_LIT>' ] <EOL> class Resp : <EOL> def __init__ ( self , json_string ) : <EOL> self . jsons = json_string <EOL> def json ( self ) : <EOL> return json . loads ( self . jsons ) <EOL> event_rep = open ( '<STR_LIT>' , '<STR_LIT:r>' ) . read ( ) <EOL> events_json = json . loads ( event_rep ) <EOL> lough = events_json [ '<STR_LIT:value>' ] [ <NUM_LIT:0> ] <EOL> oughter = events_json [ '<STR_LIT:value>' ] [ <NUM_LIT:1> ] <EOL> t_string = '<STR_LIT>' <EOL> urls = [ '<STR_LIT>' , <EOL> '<STR_LIT>' ] <EOL> def delete ( url , headers , auth ) : <EOL> if url not in urls : <EOL> raise BaseException ( '<STR_LIT>' ) <EOL> if auth [ <NUM_LIT:0> ] != '<STR_LIT>' : <EOL> raise BaseException ( '<STR_LIT>' ) <EOL> if auth [ <NUM_LIT:1> ] != '<STR_LIT>' : <EOL> raise BaseException ( '<STR_LIT>' ) <EOL> if headers [ '<STR_LIT>' ] != '<STR_LIT:application/json>' : <EOL> raise BaseException ( '<STR_LIT>' ) <EOL> if headers [ '<STR_LIT>' ] != '<STR_LIT>' : <EOL> raise BaseException ( '<STR_LIT>' ) <EOL> return True <EOL> event . requests . delete = delete <EOL> def post ( url , data , headers , auth ) : <EOL> if url != '<STR_LIT>' : <EOL> raise BaseException ( '<STR_LIT>' ) <EOL> if auth [ <NUM_LIT:0> ] != '<STR_LIT>' : <EOL> raise BaseException ( '<STR_LIT>' ) <EOL> if auth [ <NUM_LIT:1> ] != '<STR_LIT>' : <EOL> raise BaseException ( '<STR_LIT>' ) <EOL> if headers [ '<STR_LIT>' ] != '<STR_LIT:application/json>' : <EOL> raise BaseException ( '<STR_LIT>' ) <EOL> if headers [ '<STR_LIT>' ] != '<STR_LIT:application/json>' : <EOL> raise BaseException ( '<STR_LIT>' ) <EOL> if json . loads ( data ) != lough and json . loads ( data ) != oughter : <EOL> raise BaseException ( '<STR_LIT>' ) <EOL> return Resp ( data ) <EOL> event . requests . post = post <EOL> def patch ( url , data , headers , auth ) : <EOL> if url not in urls : <EOL> raise BaseException ( '<STR_LIT>' ) <EOL> if auth [ <NUM_LIT:0> ] != '<STR_LIT>' : <EOL> raise BaseException ( '<STR_LIT>' ) <EOL> if auth [ <NUM_LIT:1> ] != '<STR_LIT>' : <EOL> raise BaseException ( '<STR_LIT>' ) <EOL> if headers [ '<STR_LIT>' ] != '<STR_LIT:application/json>' : <EOL> raise BaseException ( '<STR_LIT>' ) <EOL> if headers [ '<STR_LIT>' ] != '<STR_LIT:application/json>' : <EOL> raise BaseException ( '<STR_LIT>' ) <EOL> return Resp ( data ) <EOL> event . requests . patch = patch <EOL> auth = ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> cal_json = { '<STR_LIT>' : <NUM_LIT:0> } <EOL> cal = Calendar ( cal_json , auth ) <EOL> class TestInbox ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> self . lough = event . Event ( lough , auth , cal ) <EOL> self . oughter = event . Event ( oughter , auth , cal ) <EOL> def test_create ( self ) : <EOL> self . assertTrue ( self . lough . create ( ) ) <EOL> self . assertTrue ( self . oughter . create ( ) ) <EOL> def test_update ( self ) : <EOL> self . assertTrue ( self . lough . update ( ) ) <EOL> self . assertTrue ( self . oughter . update ( ) ) <EOL> def test_delete ( self ) : <EOL> self . assertTrue ( self . lough . delete ( ) ) <EOL> self . assertTrue ( self . oughter . delete ( ) ) <EOL> def test_auth ( self ) : <EOL> self . assertEqual ( '<STR_LIT>' , self . lough . auth [ <NUM_LIT:0> ] ) <EOL> self . assertEqual ( '<STR_LIT>' , self . lough . auth [ <NUM_LIT:1> ] ) <EOL> self . assertEqual ( '<STR_LIT>' , self . oughter . auth [ <NUM_LIT:0> ] ) <EOL> self . assertEqual ( '<STR_LIT>' , self . oughter . auth [ <NUM_LIT:1> ] ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> unittest . main ( ) </s>
