def test_get_with_json_serializer(self): store = FileStore(self._dir) store.set_serializer(JsonSerializer()) store.forever('foo', {'foo': 'bar'}) result = store.get('foo') assert result == {'foo': 'bar'}
def test_none_is_returned_if_file_doesnt_exist(self): mock = flexmock(os.path) mock.should_receive('exists').once().and_return(False) store = FileStore(tempfile.gettempdir()) self.assertIsNone(store.get('foo'))