Пример #1
0
 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()
Пример #2
0
 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()
Пример #3
0
 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()
Пример #4
0
 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()