def test_double_deleting_shared_note(self): note_name = 'note_name' collection_name = 'collection_name' #update note note_file = open('../test_resources/note2.xml') update_note_action = UpdateSharedNoteAction(self.__account_id, collection_name, note_name, note_file) update_note_action.execute(callback=self.stop) response = self.wait() self.assertEqual(StorageResponse.OK, response) delete_action = DeleteSharedNoteAction(self.__account_id, collection_name, note_name) delete_action.execute(callback=self.stop) response = self.wait() self.assertEqual(StorageResponse.OK, response) delete_action2 = DeleteSharedNoteAction(self.__account_id, collection_name, note_name) delete_action2.execute(callback=self.stop) response = self.wait() self.assertEqual(StorageResponse.NOT_FOUND, response) #cleanup StorageServer.remove_collection(self.__account_id, collection_name, callback=self.stop) self.wait()
def test_update_sharing_note(self): #create collection collection_name = 'shareable_collection' file = open('../test_resources/XooML.xml') StorageServer.add_collection(user_id=self.__account_id, collection_name=collection_name, callback=self.stop, file= file) response = self.wait() self.assertEqual(StorageResponse.OK, response) #add note note_name = "noteName" note_file = open('../test_resources/note.xml') StorageServer.add_note_to_collection(self.__account_id, collection_name, note_name, note_file, callback = self.stop) response = self.wait() self.assertEqual(StorageResponse.OK, response) #update note note_file = open('../test_resources/note2.xml') update_note_action = UpdateSharedNoteAction(self.__account_id, collection_name, note_name, note_file) update_note_action.execute(callback=self.stop) response = self.wait() self.assertEqual(StorageResponse.OK, response) #cleanup StorageServer.remove_collection(self.__account_id, collection_name, callback=self.stop) self.wait()
def test_update_same_note_repeatedly(self): note_name = 'note_name' collection_name = 'collection_name' #update note note_file = open('../test_resources/note2.xml') update_note_action = UpdateSharedNoteAction(self.__account_id, collection_name, note_name, note_file) for x in range(1,5): update_note_action.execute(callback=self.stop) response = self.wait() self.assertEqual(StorageResponse.OK, response) #cleanup StorageServer.remove_collection(self.__account_id, collection_name, callback=self.stop) self.wait()