MCPcopy
hub / github.com/celery/celery / test_get_missing_key

Method test_get_missing_key

t/unit/backends/test_gcs.py:148–160  ·  view source on GitHub ↗
(self, mock_firestore_ttl, mock_get_blob)

Source from the content-addressed store, hash-verified

146 @patch.object(GCSBackend, '_get_blob')
147 @patch.object(GCSBackend, '_is_firestore_ttl_policy_enabled')
148 def test_get_missing_key(self, mock_firestore_ttl, mock_get_blob):
149 self.app.conf.gcs_bucket = 'bucket'
150 self.app.conf.gcs_project = 'project'
151
152 mock_firestore_ttl.return_value = True
153 mock_blob = Mock()
154 mock_get_blob.return_value = mock_blob
155
156 mock_blob.download_as_bytes.side_effect = NotFound('not found')
157 gcs_backend = GCSBackend(app=self.app)
158 result = gcs_backend.get('some-key')
159
160 assert result is None
161
162 @patch.object(GCSBackend, '_get_blob')
163 @patch.object(GCSBackend, '_is_firestore_ttl_policy_enabled')

Callers

nothing calls this directly

Calls 2

GCSBackendClass · 0.90
getMethod · 0.45

Tested by

no test coverage detected