示例#1
0
    def test_remove_non_existing_note(self):

        collection_name = "dummy"
        note_name = "dummy"
        StorageServer.remove_note(self.__account_id, collection_name, note_name, callback=self.stop)
        response = self.wait()
        self.assertEqual(StorageResponse.NOT_FOUND, response)
示例#2
0
    def test_remove_note(self):

        collection_name = "col_name"
        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)

        # remove
        StorageServer.remove_note(self.__account_id, collection_name, note_name, callback=self.stop)
        response = self.wait()
        self.assertEqual(StorageResponse.OK, response)

        # verify the delete
        StorageServer.list_all_notes(self.__account_id, collection_name, callback=self.stop)
        response = self.wait()
        self.assertEqual(0, len(response))
        # clean up
        StorageServer.remove_collection(self.__account_id, collection_name, callback=self.stop)
        self.wait()