Skip to content

Commit

Permalink
Sort praw.models.reddit.subreddit.SubredditWiki.create arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
LilSpazJoekp committed Jan 12, 2022
1 parent 500f3fb commit 188229f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions praw/models/reddit/subreddit.py
Original file line number Diff line number Diff line change
Expand Up @@ -4083,10 +4083,12 @@ def __iter__(self) -> Generator[WikiPage, None, None]:
for page_name in response["data"]:
yield WikiPage(self.subreddit._reddit, self.subreddit, page_name)

@_deprecate_args("name", "content", "reason")
def create(
self,
name: str,
*,
content: str,
name: str,
reason: Optional[str] = None,
**other_settings: Any,
):
Expand All @@ -4103,7 +4105,7 @@ def create(
.. code-block:: python
reddit.subreddit("test").wiki.create(
"praw_test", "wiki body text", reason="PRAW Test Creation"
name="praw_test", content="wiki body text", reason="PRAW Test Creation"
)
"""
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/models/reddit/test_subreddit.py
Original file line number Diff line number Diff line change
Expand Up @@ -2174,7 +2174,7 @@ def test_create(self, _):

with self.use_cassette():
wikipage = subreddit.wiki.create(
"PRAW New Page", "This is the new wiki page"
name="PRAW New Page", content="This is the new wiki page"
)
assert wikipage.name == "praw_new_page"
assert wikipage.content_md == "This is the new wiki page"
Expand Down

0 comments on commit 188229f

Please sign in to comment.