• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

praw-dev / praw / 3768928224

pending completion
3768928224

Pull #1923

github

GitHub
Merge 33b610e6e into ffe9f71d6
Pull Request #1923: Improve tests, clean up test code, and sort test functions/classes

4109 of 4109 relevant lines covered (100.0%)

4.0 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

100.0
/praw/models/front.py
1
"""Provide the Front class."""
2
from typing import TYPE_CHECKING, Iterator, Union
4✔
3
from urllib.parse import urljoin
4✔
4

5
from .listing.generator import ListingGenerator
4✔
6
from .listing.mixins import SubredditListingMixin
4✔
7

8
if TYPE_CHECKING:  # pragma: no cover
9
    import praw
10

11

12
class Front(SubredditListingMixin):
4✔
13
    """Front is a Listing class that represents the front page."""
14

15
    def __init__(self, reddit: "praw.Reddit"):
4✔
16
        """Initialize a :class:`.Front` instance."""
17
        super().__init__(reddit, _data=None)
4✔
18
        self._path = "/"
4✔
19

20
    def best(
4✔
21
        self, **generator_kwargs: Union[str, int]
22
    ) -> Iterator["praw.models.Submission"]:
23
        """Return a :class:`.ListingGenerator` for best items.
24

25
        Additional keyword arguments are passed in the initialization of
26
        :class:`.ListingGenerator`.
27

28
        """
29
        return ListingGenerator(
4✔
30
            self._reddit, urljoin(self._path, "best"), **generator_kwargs
31
        )
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc