changeset 4580:606234778ffc

fixing cache action tests: headers cache now stores (key, value) tuples
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sun, 15 Feb 2009 01:57:19 +0100
parents 87d97510de79
children 70a0acbf0bb3
files MoinMoin/action/_tests/test_cache.py
diffstat 1 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/action/_tests/test_cache.py	Sun Feb 15 01:37:51 2009 +0100
+++ b/MoinMoin/action/_tests/test_cache.py	Sun Feb 15 01:57:19 2009 +0100
@@ -70,8 +70,8 @@
                                         key=key+'.meta', use_pickle=True)
         meta = meta_cache.content()
         assert meta['httpdate_last_modified'].endswith(' GMT') # only a very rough check, it has used cache mtime as last_modified
-        assert "Content-Type: application/octet-stream" in meta['headers']
-        assert "Content-Length: %d" % len(data) in meta['headers']
+        assert ("Content-Type", "application/octet-stream") in meta['headers']
+        assert ("Content-Length", len(data)) in meta['headers']
 
     def test_put_cache_guess_ct_give_lm(self):
         """Test if put_cache() works, when we give filename (so it guesses content_type) and last_modified"""
@@ -89,8 +89,8 @@
                                         key=key+'.meta', use_pickle=True)
         meta = meta_cache.content()
         assert meta['httpdate_last_modified'] == 'Thu, 01 Jan 1970 00:00:01 GMT'
-        assert "Content-Type: image/png" in meta['headers']
-        assert "Content-Length: %d" % len(data) in meta['headers']
+        assert ("Content-Type", "image/png") in meta['headers']
+        assert ("Content-Length", len(data)) in meta['headers']
 
     def test_put_cache_file_like_data(self):
         """Test if put_cache() works when we give it a file like object for the content"""
@@ -109,8 +109,8 @@
                                         key=key+'.meta', use_pickle=True)
         meta = meta_cache.content()
         assert meta['httpdate_last_modified'].endswith(' GMT') # only a very rough check, it has used cache mtime as last_modified
-        assert "Content-Type: application/octet-stream" in meta['headers']
-        assert "Content-Length: %d" % len(data) in meta['headers']
+        assert ("Content-Type", "application/octet-stream") in meta['headers']
+        assert ("Content-Length", len(data)) in meta['headers']
 
         data_cache = caching.CacheEntry(request,
                                         arena=cache.cache_arena,