Пример #1
0
def test_invoke_calls_redditclient_fetch_attachment_returned():
    reddit_client = RedditApiClient("fakeurl")
    reddit_client.fetch = MagicMock(return_value=['test'])
    a = Aww()
    a.reddit_client = reddit_client
    text, attachments = a.invoke("aww", "fakeuser")
    assert attachments == ['test']
Пример #2
0
def test_invoke_calls_redditclient_fetch_attachment_returned():
    reddit_client = RedditApiClient("fakeurl")
    reddit_client.fetch = MagicMock(return_value=['test'])
    t = TeslaMe()
    t.reddit_client=reddit_client
    text,attachments = t.invoke("teslame","fakeuser")
    assert attachments == ['test']   
Пример #3
0
def test_dogme_invoke_calls_redditclient_fetch_attachment_returned():
    reddit_client = RedditApiClient("fakeurl")
    reddit_client.fetch = MagicMock(return_value=['test'])
    dogme = DogMe()
    dogme.reddit_client = reddit_client
    text, attachments = dogme.invoke("dogme", "fakeuser")
    assert attachments == ['test']
Пример #4
0
def test_invoke_calls_redditclient_fetch_text_is_none():
    reddit_client = RedditApiClient("fakeurl")
    reddit_client.fetch = MagicMock(return_value=['test'])
    t = TortoiseMe()
    t.reddit_client = reddit_client

    text, attachments = t.invoke("dogme", "fakeuser")
    assert text is None