Exemple #1
0
    def __init__(self, node, **kwargs):
        super(NodeResults, self).__init__(**kwargs)
        self.node = node

        if "in" not in self: self["in"] = Namespace()
        if "out" not in self: self["out"] = Namespace()
        if "exceptions" not in self: self["exceptions"] = []
        if "files" not in self: self["files"] = Namespace()
Exemple #2
0
 def test_namespace_dict(self):
     d = Namespace(foo="bar")
     d["hello"] = "world"
     self.assertEqual(d["foo"], "bar")
     self.assertRaises(KeyError, d.__setitem__, "foo", "spam")