Exemple #1
0
def test_article_event_has_authors_as_an_array(raw_article):
    event = pocket.article_to_event(raw_article)

    assert event["authors"] == [{u'author_id': u'9109759',
                           u'item_id': u'605584922',
                           u'name': u'Matt Gemmell',
                           u'url': u'http://mattgemmell.com/about'}]
Exemple #2
0
def test_cleanup_article_converts_word_count_to_int(raw_article):
    event = pocket.article_to_event(raw_article)

    assert event["word_count"] == 1943
Exemple #3
0
def test_cleanup_article_data_replaces_empty_timestamps_with_nones(raw_article):
    event = pocket.article_to_event(raw_article)

    assert event["time_favorited"] is None
Exemple #4
0
def test_cleanup_article_data_uses_bools(raw_article):
    event = pocket.article_to_event(raw_article)

    assert event["is_article"]
    assert event["favorite"] is False
Exemple #5
0
def test_cleanup_article_data_transforms_timestamps(raw_article):
    event = pocket.article_to_event(raw_article)

    assert event["time_added"] == "2014-05-17T12:36:45"