def test_memoizes(self):
        called = [0]

        @persistent_memoize
        def target(arg):
            """Test function..."""
            called[0] += 1
            return 2 * arg

        result1 = target(1)
        self.assertEqual(result1, 2)
        self.assertEqual(called[0], 1)

        result2 = target(1)
        self.assertEqual(result2, 2)
        self.assertEqual(called[0], 1)

        result3 = target(2)
        self.assertEqual(result3, 4)
        self.assertEqual(called[0], 2)

        result4 = target(1)
        self.assertEqual(result4, 2)
        self.assertEqual(called[0], 2)

        result5 = target(2)
        self.assertEqual(result5, 4)
        self.assertEqual(called[0], 2)
Test if memoization works
dataset/ETHPy150Open duerrp/pyexperiment/tests/test_persistent_memoize.py/TestPersistentMemoize.test_memoizes