Exemplo n.º 1
0
    def setUp(self):
        self.object_cache_patcher = mock.patch.dict(
            'robottelo.decorators.OBJECT_CACHE')
        self.object_cache = self.object_cache_patcher.start()

        def make_foo(options):
            return {'id': 42}

        self.make_foo = decorators.cacheable(make_foo)
Exemplo n.º 2
0
    def setUp(self):
        self.object_cache_patcher = mock.patch.dict(
            'robottelo.decorators.OBJECT_CACHE')
        self.object_cache = self.object_cache_patcher.start()

        def make_foo(options):
            return {'id': 42}

        self.make_foo = decorators.cacheable(make_foo)
Exemplo n.º 3
0
    def make_foo(self):
        mocked_object_cache_patcher = mock.patch.dict(
            'robottelo.decorators.OBJECT_CACHE')
        mocked_object_cache_patcher.start()

        # decorators.cacheable uses the function name as the key, removing make_
        def make_foo(options):
            return {'id': 42}

        yield decorators.cacheable(make_foo)

        mocked_object_cache_patcher.stop()