# -*- coding: UTF-8 -*-
from pprint import pprint

from feedrsub.ingestion.parsers.rss.rss_item_parser import RssItemParser
from feedrsub.models.author import Author
from feedrsub.models.author_map import AuthorMap
from feedrsub.models.entry import Entry
from tests.conftest import valid_uuid
from tests.factories import faker


def test_item_guid():
    id = faker.url()
    item = dict(id=id)
    parser = RssItemParser(item)
    assert parser.item_guid(item) == id


def test_item_guid_from_link_and_none_id():
    link = faker.url()
    item = dict(id=None, link=link)
    parser = RssItemParser(item)