Example #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()
Example #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()
Example #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()
Example #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()