MCPcopy
hub / github.com/google/earthengine-api / test_get_task_status

Method test_get_task_status

python/ee/tests/data_test.py:215–234  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

213 )
214
215 def test_get_task_status(self):
216 cloud_api_resource = mock.MagicMock()
217 with apitestcase.UsingCloudApi(cloud_api_resource=cloud_api_resource):
218 cloud_api_resource.projects().operations().get.return_value.execute.return_value = {
219 'name': 'projects/earthengine-legacy/operations/foo',
220 'done': False,
221 'metadata': {'state': 'RUNNING'},
222 }
223 result = ee.data.getTaskStatus('foo')
224 cloud_api_resource.projects().operations().get.assert_called_once_with(
225 name='projects/earthengine-legacy/operations/foo'
226 )
227 self.assertEqual(
228 result,
229 [{
230 'id': 'foo',
231 'state': 'RUNNING',
232 'name': 'projects/earthengine-legacy/operations/foo',
233 }],
234 )
235
236 def test_get_task_status_with_not_found(self):
237 cloud_api_resource = mock.MagicMock()

Callers

nothing calls this directly

Calls 2

operationsMethod · 0.80
projectsMethod · 0.80

Tested by

no test coverage detected