Commit a0724811 by Chris Jerdonek

Implemented Context.push().

parent 55846ad7
......@@ -136,4 +136,7 @@ class Context(object):
return default
def push(self, item):
self._stack.append(item)
......@@ -217,3 +217,15 @@ class ContextTestCase(TestCase):
context = Context({"fuzz": "buzz"}, {"foo": "bar"})
self.assertEquals(context.get("fuzz"), "buzz")
def test_push(self):
"""
Test push().
"""
key = "foo"
context = Context({key: "bar"})
self.assertEquals(context.get(key), "bar")
context.push({key: "buzz"})
self.assertEquals(context.get(key), "buzz")
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment