(self)
| 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() |
nothing calls this directly
no test coverage detected