Exemple #1
0
def test_item_to_key__no_guid_or_link():
    rss_data = (
        """<item>
            <title>Item title</title>
        </item>"""
    )
    rss_elem = ElementTree.fromstring(rss_data)
    rf = RssSource(TEST_RSS)

    assert rf.item_to_key(rss_elem) != "Item title"

    key1 = rf.item_to_key(rss_elem)
    key2 = rf.item_to_key(rss_elem)

    assert key1 == key2
Exemple #2
0
def test_item_to_key__no_guid():
    rss_data = (
        """<item>
            <title>Item title</title>
            <link>http://example.com/item</link>
        </item>"""
    )
    rss_elem = ElementTree.fromstring(rss_data)
    rf = RssSource(TEST_RSS)

    assert rf.item_to_key(rss_elem) == "http://example.com/item"