Esempio n. 1
0
    def test_delete_shared_note_non_existing_note(self):

        delete_action = DeleteSharedNoteAction(self.__account_id,
            'dummy', 'dummer')
        delete_action.execute(callback=self.stop)
        response = self.wait()
        self.assertEqual(StorageResponse.NOT_FOUND, response)
Esempio n. 2
0
    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()