chrisbillows / raindrop-todoist-syncer

Converts favourited Raindrops into tasks in Todoist.
2 stars 1 forks source link

Fix minor bug in `Raindrop` class #44

Open chrisbillows opened 6 months ago

chrisbillows commented 6 months ago

Error handling needs to be added to the Raindrop class for a missing field. This has never happened but just in case. Currently it will crash, as per the below test:

def test_id_field_missing(self):
        fav = [
            {
                "created": "1955-11-05T01:24:00.111Z",
                "parsed_time": "1955-11-05T01:24:00.111Z",
                "title": "Marty! You gotta come back with me!",
                "note": "Back where?",
                "link": "www.backtothefuture!.com",
            }
        ]
        rdp = RaindropsProcessor(fav)
        rd_objects = rdp._convert_to_rd_objects(fav)
        assert rd_objects == []

This test is currently skipped and needs to be reinstated once the error handling is added.