Exemplo n.º 1
0
 def test_get_cache_key_no_key(self):
     # contexts w/o given key result in ``None``
     base = OOOTransformBase()
     context = FakeContext()
     stream = datastream('mystream')
     stream.context = context
     result = base.get_cache_key('invalid-key', stream)
     assert result is None
Exemplo n.º 2
0
 def test_get_cache_key(self):
     # OOOTransformBase instances can get cache keys
     base = OOOTransformBase()
     context = FakeContext()
     stream = datastream('mystream')
     stream.context = context
     result = base.get_cache_key('some_key', stream)
     assert result == 'foo'
Exemplo n.º 3
0
 def test_get_cache_key_no_context(self):
     # objects w/o context are ignored
     base = OOOTransformBase()
     result = base.get_cache_key('invalid-key', None)
     assert result is None