コード例 #1
0
ファイル: test_containers.py プロジェクト: pkediyal/pyon
    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"
コード例 #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'