

def test_content_submission_from_url(reddit, oauth, refresh_token, terminal):
    url = 'https://www.reddit.com/r/AskReddit/comments/2np694/'
    SubmissionContent.from_url(reddit, url, terminal.loader)
    SubmissionContent.from_url(reddit, url, terminal.loader, order='new')
    with terminal.loader():
        SubmissionContent.from_url(reddit, url, terminal.loader, order='fake')
    assert (not terminal.loader.exception)
    with terminal.loader():
        SubmissionContent.from_url(reddit, url[:(- 2)], terminal.loader)
    assert isinstance(terminal.loader.exception, praw.errors.NotFound)
    oauth.config.refresh_token = refresh_token
    oauth.authorize()
    url = 'https://np.reddit.com//r/LifeProTips/comments/441hsf//czmp112.json'
    with terminal.loader():
        SubmissionContent.from_url(reddit, url, terminal.loader)
    assert (not terminal.loader.exception)

dataset/ETHPy150Open michael-lazar/rtv/tests/test_content.py test_content_submission_from_url/original