示例#1
0
    def test_module_props(self):
        @property
        def this(mod):
            return mod

        import testbed
        module, created, klass = customize(testbed,
                                           custom_attrs={'this': this})
        self.assertEqual(module, module.this)
示例#2
0
    def apply(self):
        from xoeuf.odoo.modules import module

        patched = getattr(module, "__xoeuf_patched__", False)
        if patched:
            # This is an Odoo that's being patched by us.
            return
        bootstraped = getattr(self, "bootstraped", False)
        if not bootstraped:
            for name, _func in self._registry.items():
                self._wrapped[name] = getattr(module, name)
            module = customize(module)[0]
            for name, func in self._registry.items():
                setattr(module, name, func)
            self.bootstraped = True
示例#3
0
 def test_echo(self):
     import testbed
     module, created, klass = customize(testbed)
     self.assertEqual(10, module.echo(10))