Skip to content

Commit

Permalink
Add unit test for forum_post_revisions.py
Browse files Browse the repository at this point in the history
  • Loading branch information
emmiegit committed Mar 21, 2024
1 parent 9be3c46 commit ef7ab59
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions test/test_forum_post_revisions.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import unittest
from unittest.mock import patch

import requests

from yellowstone.request import forum_post_revisions

from .helpers import FakeResponse, make_wikidot


class TestForumPostRevisions(unittest.TestCase):
def setUp(self):
self.wikidot = make_wikidot()

def test_forum_posts(self):
http_response = FakeResponse.ajax_from_file("forum_post_revisions")
with patch.object(requests, "post", return_value=http_response) as mock:
revision_ids = forum_post_revisions.get(
site_slug="scp-wiki",
category_id=88827,
thread_id=561991,
post_id=1782850,
wikidot=self.wikidot,
)
mock.assert_called_once()

self.assertEqual(revision_ids, [7841563, 7841564, 7841565, 7841566, 7841567])

0 comments on commit ef7ab59

Please sign in to comment.