MCPcopy
hub / github.com/celery/celery / test_get_key

Method test_get_key

t/unit/backends/test_gcs.py:107–117  ·  view source on GitHub ↗
(self, mock_ttl, mock_get_blob, base_path)

Source from the content-addressed store, hash-verified

105 @patch.object(GCSBackend, '_get_blob')
106 @patch.object(GCSBackend, '_is_firestore_ttl_policy_enabled')
107 def test_get_key(self, mock_ttl, mock_get_blob, base_path):
108 self.app.conf.gcs_base_path = base_path
109
110 mock_ttl.return_value = True
111 mock_blob = Mock()
112 mock_get_blob.return_value = mock_blob
113 backend = GCSBackend(app=self.app)
114 backend.get(b"testkey1")
115
116 mock_get_blob.assert_called_once_with('testkey1')
117 mock_blob.download_as_bytes.assert_called_once()
118
119 @patch.object(GCSBackend, 'bucket')
120 @patch.object(GCSBackend, '_get_blob')

Callers

nothing calls this directly

Calls 2

GCSBackendClass · 0.90
getMethod · 0.45

Tested by

no test coverage detected