Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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"
)
def tearDown(self):
# Unstub caching
pypistats._cache_filename = self.original__cache_filename
pypistats._save_cache = self.original__save_cache
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
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