

def test_content_submission(reddit, terminal):
    url = 'https://www.reddit.com/r/Python/comments/2xmo63/'
    submission = reddit.get_submission(url)
    content = SubmissionContent(submission, terminal.loader)
    assert (len(content._comment_data) == 45)
    assert (content.get((- 1))['type'] == 'Submission')
    assert (content.get(40)['type'] == 'Comment')
    for data in content.iterate((- 1), 1):
        assert all(((k in data) for k in ('object', 'n_rows', 'offset', 'type', 'hidden')))
        for val in data.values():
            assert (not isinstance(val, six.binary_type))
    with pytest.raises(IndexError):
        content.get((- 2))
    with pytest.raises(IndexError):
        content.get(50)
    content.toggle((- 1))
    assert (len(content._comment_data) == 45)
    content.toggle(2)
    data = content.get(2)
    assert (data['type'] == 'HiddenComment')
    assert (data['count'] == 3)
    assert (k['hidden'] is True)
    assert (data['level'] >= content.get(3)['level'])
    assert (len(content._comment_data) == 43)
    content.toggle(2)
    data = content.get(2)
    assert (data['hidden'] is False)
    assert (len(content._comment_data) == 45)

dataset/ETHPy150Open michael-lazar/rtv/tests/test_content.py test_content_submission/VarMisuse@249/314 `data`->`k`