diff options
| author | shadchin <[email protected]> | 2022-02-10 16:44:39 +0300 |
|---|---|---|
| committer | Daniil Cherednik <[email protected]> | 2022-02-10 16:44:39 +0300 |
| commit | e9656aae26e0358d5378e5b63dcac5c8dbe0e4d0 (patch) | |
| tree | 64175d5cadab313b3e7039ebaa06c5bc3295e274 /contrib/python/Jinja2/py2/tests/test_bytecode_cache.py | |
| parent | 2598ef1d0aee359b4b6d5fdd1758916d5907d04f (diff) | |
Restoring authorship annotation for <[email protected]>. Commit 2 of 2.
Diffstat (limited to 'contrib/python/Jinja2/py2/tests/test_bytecode_cache.py')
| -rw-r--r-- | contrib/python/Jinja2/py2/tests/test_bytecode_cache.py | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/contrib/python/Jinja2/py2/tests/test_bytecode_cache.py b/contrib/python/Jinja2/py2/tests/test_bytecode_cache.py index ab056bcc9f2..c7882b1a2df 100644 --- a/contrib/python/Jinja2/py2/tests/test_bytecode_cache.py +++ b/contrib/python/Jinja2/py2/tests/test_bytecode_cache.py @@ -2,23 +2,23 @@ import pytest from jinja2 import Environment -from jinja2.bccache import Bucket -from jinja2.bccache import FileSystemBytecodeCache -from jinja2.bccache import MemcachedBytecodeCache +from jinja2.bccache import Bucket +from jinja2.bccache import FileSystemBytecodeCache +from jinja2.bccache import MemcachedBytecodeCache from jinja2.exceptions import TemplateNotFound @pytest.fixture -def env(package_loader, tmp_path): - bytecode_cache = FileSystemBytecodeCache(str(tmp_path)) - return Environment(loader=package_loader, bytecode_cache=bytecode_cache) +def env(package_loader, tmp_path): + bytecode_cache = FileSystemBytecodeCache(str(tmp_path)) + return Environment(loader=package_loader, bytecode_cache=bytecode_cache) class TestByteCodeCache(object): def test_simple(self, env): - tmpl = env.get_template("test.html") - assert tmpl.render().strip() == "BAR" - pytest.raises(TemplateNotFound, env.get_template, "missing.html") + tmpl = env.get_template("test.html") + assert tmpl.render().strip() == "BAR" + pytest.raises(TemplateNotFound, env.get_template, "missing.html") class MockMemcached(object): @@ -49,22 +49,22 @@ class TestMemcachedBytecodeCache(object): memcached = MockMemcached() m = MemcachedBytecodeCache(memcached) - b = Bucket(None, "key", "") - b.code = "code" + b = Bucket(None, "key", "") + b.code = "code" m.dump_bytecode(b) - assert memcached.key == "jinja2/bytecode/key" + assert memcached.key == "jinja2/bytecode/key" - b = Bucket(None, "key", "") + b = Bucket(None, "key", "") m.load_bytecode(b) - assert b.code == "code" + assert b.code == "code" def test_exception(self): memcached = MockMemcached() memcached.get = memcached.get_side_effect memcached.set = memcached.set_side_effect m = MemcachedBytecodeCache(memcached) - b = Bucket(None, "key", "") - b.code = "code" + b = Bucket(None, "key", "") + b.code = "code" m.dump_bytecode(b) m.load_bytecode(b) |
