From dbc811e4cc02f8b84353975eec3889dd4c1740fb Mon Sep 17 00:00:00 2001 From: Ben van Werkhoven Date: Thu, 20 Jun 2024 16:35:22 +0200 Subject: [PATCH] update test read-only cache --- test/test_cachefile_class.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/test_cachefile_class.py b/test/test_cachefile_class.py index fa07eac7..cefecac2 100644 --- a/test/test_cachefile_class.py +++ b/test/test_cachefile_class.py @@ -306,8 +306,9 @@ def assert_cache_unchanged(self, cache_file, cache_backup_file): assert cache.read() == backup.read() def test_read__cannot_modify(self, cache_file, full_cache_line, assert_cache_unchanged): - cache = Cache.read(cache_file) - cache.lines.append(**vars(full_cache_line)) + cache = Cache.read(cache_file, read_only=True) + with pytest.raises(ValueError): + cache.lines.append(**vars(full_cache_line)) def test_read__outdated(self): cache = Cache.read(XXL_CACHE_PATH)