def test_parse_annotations(self): mock_entry = get_mock_entry() expected_comments = ['comment one', 'comment two'] expected_highlights = ['highlight one', 'highlight two'] annotations = data.parse_annotations(mock_entry) comments = annotations[0] highlights = annotations[1] self.assertEqual(comments, expected_comments) self.assertEqual(highlights, expected_highlights)
def test_parse_missing_annotations(self): mock_entry = get_mock_entry() del (mock_entry['annotations']) expected_comments = None expected_highlights = None annotations = data.parse_annotations(mock_entry) comments = annotations[0] highlights = annotations[1] self.assertEqual(comments, expected_comments) self.assertEqual(highlights, expected_highlights)