def __init__(self, identity=None, *args, **kwargs): self.identity = identity or FakeIdentity() self.name = "fake" self.prefix = "" self.service_type = "fake" self.clients = {} self.endpoints = utils.DotDict()
def test_dot_dict(self): key = "fake" val = utils.random_unicode() dct = {key: val} dd = utils.DotDict(dct) self.assertEqual(dd.fake, val) self.assertRaises(AttributeError, getattr, dd, "bogus")