Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
mondeja committed Aug 4, 2023
1 parent 996ee24 commit 166967d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tests/test_unit/test_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,11 +361,16 @@ def test_read_url_cached_content(tmp_path):
cached_file_path = tmp_path / cached_file_name
if cached_file_path.exists():
cached_file_path.unlink()

cache = Cache(cache_dir, 600)
content = read_url(url, cache)
assert cached_file_path.exists()
cached_content = cached_file_path.read_text().split('\n', 1)[1]

cached_content = cached_file_path.read_text(
encoding='utf-8',
).split('\n', 1)[1]
assert content == cached_content

assert cache.get_(url) == cached_content
assert cache.get_(url) == read_url(url, cache)
cached_file_path.unlink()

0 comments on commit 166967d

Please sign in to comment.