def testRestCacheCaller_NonLoadable(self): cache.global_cache.set('foo', '{ not valid json') m = mock.Mock() m.return_value = 5 self.assertEqual(5, cache._rest_cache_caller(m, 'foo')) self.assertEqual(5, cache._rest_cache_caller(m, 'foo')) m.assert_called_once()
def testRestCacheCaller_NonSerializable(self): m = mock.Mock() m.return_value = mock.Mock() m.return_value.foo = 5 self.assertEqual(5, cache._rest_cache_caller(m, 'foo').foo) m.assert_called_once()