def setUp(self): self.stubs = stubout.StubOutForTesting() self.handler = AtomPub() self.mox = mox.Mox() def get(*args, **kwargs): val = None for arg in args: if val: val = val.get(arg) else: val = AtomPubTests.config_dict.get(arg) if not val: return None or kwargs.get('default') return val def config_with(*args): return functools.partial(get, args) self.stubs.Set(yagi.config, 'config_with', config_with) self.stubs.Set(yagi.config, 'get', get)