Ejemplo n.º 1
0
    def test_dotdict_builtin_error(self):
        # Ensures that you can not override the builtin methods
        base = DotDict()
        with self.assertRaises(AttributeError):
            base.pop = "shouldnt work"
        with self.assertRaises(AttributeError):
            base.__getitem__ = "really shouldnt work"

        with self.assertRaises(AttributeError):
            base.another.chained.pop = "again should not work"
Ejemplo n.º 2
0
    def test_dotdict_builtin_error(self):
        # Ensures that you can not override the builtin methods
        base = DotDict()
        with self.assertRaises(AttributeError):
            base.pop = 'shouldnt work'
        with self.assertRaises(AttributeError):
            base.__getitem__ = 'really shouldnt work'

        with self.assertRaises(AttributeError):
            base.another.chained.pop = 'again should not work'