Skip to content

Commit

Permalink
Fix docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
vaclav-2012 committed Jun 14, 2020
1 parent 62464e5 commit 5abcbce
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 13 deletions.
2 changes: 1 addition & 1 deletion slow_start_rewatch/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class AuthorizationError(SlowStartRewatchException):


class RedditError(SlowStartRewatchException):
"""Indicates error when accessing Reddit API."""
"""Indicates an error when accessing Reddit API."""


class InvalidRefreshToken(SlowStartRewatchException):
Expand Down
2 changes: 1 addition & 1 deletion slow_start_rewatch/post.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@


class Post(object):
"""Represents scheduled Reddit post."""
"""Represents a scheduled Reddit post."""

def __init__(
self,
Expand Down
4 changes: 2 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def post():

@pytest.fixture()
def reddit(submission):
"""Return mock Reddit class."""
"""Return mock `Reddit` class."""
mock_reddit = mock.Mock()
mock_reddit.auth.scopes.return_value = ["headpat", "hug"]
mock_reddit.auth.url.return_value = "cute_resource_locator"
Expand All @@ -98,7 +98,7 @@ def reddit(submission):

@pytest.fixture()
def submission():
"""Return mock Submission."""
"""Return mock `Submission`."""
mock_submission = mock.Mock()
mock_submission.permalink = "slow_start_post_link"

Expand Down
8 changes: 4 additions & 4 deletions tests/test_post.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@


def test_create():
"""Test creating a Post instance."""
"""Test creating a `Post` instance."""
post = Post(
submit_at=datetime(2018, 1, 6, 12, 0, 0),
subreddit="anime",
Expand All @@ -23,7 +23,7 @@ def test_create():


def test_create_with_empty_field():
"""Test that the Post cannot be instantiated with empty attributes."""
"""Test that the `Post` cannot be instantiated with empty attributes."""
with pytest.raises(AttributeError):
Post(
submit_at=datetime(2018, 1, 6, 12, 0, 0),
Expand All @@ -34,7 +34,7 @@ def test_create_with_empty_field():


def test_comparison():
"""Test the comparison of Post objects."""
"""Test the comparison of `Post` objects."""
post = Post(
submit_at=datetime(2018, 1, 6, 12, 0, 0),
subreddit="anime",
Expand Down Expand Up @@ -62,7 +62,7 @@ def test_comparison():


def test_string_representation():
"""Test the string representation of a Post instance."""
"""Test the string representation of a `Post` instance."""
post = Post(
submit_at=datetime(2018, 1, 6, 12, 0, 0),
subreddit="anime",
Expand Down
11 changes: 6 additions & 5 deletions tests/test_reddit_cutifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,11 @@ def test_authorize(
"""
Test initialization and authorization.
1. Ensure that Reddit instance is initialized with the correct arguments.
1. Ensure that the `Reddit` instance is initialized with the correct
arguments.
2. Check that the :meth:`OAuthHelper.authorize()` is called during the
authorization.
authorization.
"""
reddit_cutifier_config.refresh_token = REFRESH_TOKEN
reddit_cutifier = RedditCutifier(reddit_cutifier_config)
Expand Down Expand Up @@ -62,7 +63,7 @@ def test_username(
reddit_cutifier_config,
reddit,
):
"""Test that the username is retrieved from PRAW correctly."""
"""Test that the username is retrieved from `PRAW` correctly."""
reddit_cutifier = RedditCutifier(reddit_cutifier_config)
reddit_cutifier.reddit = reddit

Expand All @@ -84,7 +85,7 @@ def test_submit_post(
post,
):
"""
Test that :meth:`RedditCutifier.submit_post()` uses PRAW methods correctly.
Test that :meth:`RedditCutifier.submit_post()` uses `PRAW` correctly.
1. Test a successful post submission.
Expand All @@ -106,7 +107,7 @@ def test_submit_post(

@pytest.fixture()
def reddit_cutifier_config():
"""Return mock Config for testing RedditCutifier."""
"""Return the mock `Config` for testing the `RedditCutifier`."""
return MockConfig({
"reddit": {
"client_id": "fluffy_client_id",
Expand Down

0 comments on commit 5abcbce

Please sign in to comment.