Skip to content

Instantly share code, notes, and snippets.

@leviroth
Created March 20, 2017 00:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save leviroth/2a7c85bfc1a5de839e741d770d5a8c8e to your computer and use it in GitHub Desktop.
Save leviroth/2a7c85bfc1a5de839e741d770d5a8c8e to your computer and use it in GitHub Desktop.
ServerError in PRAW tests
from praw.models import ModmailMessage
import mock
from ... import IntegrationTest
class TestModmail(IntegrationTest):
@mock.patch('time.sleep', return_value=None)
def test_call__conversation_id(self, _):
conversation_id = 'ik72'
with self.recorder.use_cassette(
'TestModmail.test_call__conversation_id'):
conversation = self.reddit.subreddit('all').modmail(
conversation_id)
for message in conversation.messages:
assert isinstance(message, ModmailMessage)
import praw
user_agent = "praw test"
r = praw.Reddit(user_agent=user_agent)
def test_call__conversation_id():
conversation_id = 'ik72'
conversation = r.subreddit('all').modmail(conversation_id)
for message in conversation.messages:
assert isinstance(message, praw.models.ModmailMessage)
print(message)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment