Commit 55846ad7 by Chris Jerdonek

Cleaned up and removed redundant unit tests of the context module.

parent e00931d4
...@@ -177,21 +177,21 @@ class ContextTestCase(TestCase): ...@@ -177,21 +177,21 @@ class ContextTestCase(TestCase):
""" """
context = Context({}, {}, {}) context = Context({}, {}, {})
def test_get__missing_key(self): def test_get__key_present(self):
""" """
Test getting a missing key. Test getting a key.
""" """
context = Context() context = Context({"foo": "bar"})
self.assertTrue(context.get("foo") is None) self.assertEquals(context.get("foo"), "bar")
def test_get__dictionary_methods_not_queried(self): def test_get__key_missing(self):
""" """
Test getting a missing key. Test getting a missing key.
""" """
context = Context() context = Context()
#self.assertEquals(context.get("keys"), 2) self.assertTrue(context.get("foo") is None)
def test_get__default(self): def test_get__default(self):
""" """
...@@ -201,14 +201,6 @@ class ContextTestCase(TestCase): ...@@ -201,14 +201,6 @@ class ContextTestCase(TestCase):
context = Context() context = Context()
self.assertEquals(context.get("foo", "bar"), "bar") self.assertEquals(context.get("foo", "bar"), "bar")
def test_get__key_present(self):
"""
Test get() with a key that is present.
"""
context = Context({"foo": "bar"})
self.assertEquals(context.get("foo"), "bar")
def test_get__precedence(self): def test_get__precedence(self):
""" """
Test that get() respects the order of precedence (later items first). Test that get() respects the order of precedence (later items first).
...@@ -225,19 +217,3 @@ class ContextTestCase(TestCase): ...@@ -225,19 +217,3 @@ class ContextTestCase(TestCase):
context = Context({"fuzz": "buzz"}, {"foo": "bar"}) context = Context({"fuzz": "buzz"}, {"foo": "bar"})
self.assertEquals(context.get("fuzz"), "buzz") self.assertEquals(context.get("fuzz"), "buzz")
def test_get__object_attribute(self):
"""
Test that object attributes are queried.
"""
context = Context(SimpleObject())
self.assertEquals(context.get("foo"), "bar")
def test_get__object_callable(self):
"""
Test that object callables are queried.
"""
context = Context(SimpleObject())
#self.assertEquals(context.get("foo_callable"), "called...")
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