

def test_content_subreddit(reddit, terminal):
    submissions = reddit.get_front_page(limit=5)
    content = SubredditContent('front', submissions, terminal.loader)
    assert (len(submissions._submission_data) == 1)
    assert (content.get(0)['type'] == 'Submission')
    for data in content.iterate(0, 1):
        assert all(((k in data) for k in ('object', 'n_rows', 'offset', 'type', 'index', 'title', 'split_title', 'hidden')))
        for val in data.values():
            assert (not isinstance(val, six.binary_type))
    with pytest.raises(IndexError):
        content.get((- 1))
    with pytest.raises(IndexError):
        content.get(5)

dataset/ETHPy150Open michael-lazar/rtv/tests/test_content.py test_content_subreddit/VarMisuse@40/53 `content`->`submissions`