How to use the pypistats._cache_filename function in pypistats

To help you get started, we’ve selected a few pypistats examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github hugovk / pypistats / tests / test_pypistats_cache.py View on Github external
def test__cache_filename(self):
        # Arrange
        url = "https://pypistats.org/api/packages/pip/recent"

        # Act
        out = pypistats._cache_filename(url)

        # Assert
        self.assertTrue(
            str(out).endswith(
                "2018-12-26-https-pypistats-org-api-packages-pip-recent.json"
            )
github hugovk / pypistats / tests / test_pypistats.py View on Github external
def tearDown(self):
        # Unstub caching
        pypistats._cache_filename = self.original__cache_filename
        pypistats._save_cache = self.original__save_cache
github hugovk / pypistats / tests / test_pypistats.py View on Github external
def setUp(self):
        # Stub caching. Caches are tested in another class.
        self.original__cache_filename = pypistats._cache_filename
        self.original__save_cache = pypistats._save_cache
        pypistats._cache_filename = stub__cache_filename
        pypistats._save_cache = stub__save_cache
github hugovk / pypistats / tests / test_pypistats.py View on Github external
def setUp(self):
        # Stub caching. Caches are tested in another class.
        self.original__cache_filename = pypistats._cache_filename
        self.original__save_cache = pypistats._save_cache
        pypistats._cache_filename = stub__cache_filename
        pypistats._save_cache = stub__save_cache