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

Method test_create_assets

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

Source from the content-addressed store, hash-verified

413 })
414
415 def test_create_assets(self):
416 cloud_api_resource = mock.MagicMock()
417 with apitestcase.UsingCloudApi(cloud_api_resource=cloud_api_resource):
418 asset_name = 'projects/some-project/assets/some-asset'
419 cloud_api_resource.projects().assets().get().execute.side_effect = (
420 NotFoundError()
421 )
422 ee.data.create_assets([asset_name], 'FOLDER', False)
423 mock_create_asset = cloud_api_resource.projects().assets().create
424 mock_create_asset.assert_called_once_with(
425 parent='projects/some-project',
426 assetId='some-asset',
427 body={'type': 'FOLDER'},
428 prettyPrint=False,
429 )
430
431 def test_create_assets_empty(self):
432 cloud_api_resource = mock.MagicMock()

Callers

nothing calls this directly

Calls 4

NotFoundErrorFunction · 0.85
assetsMethod · 0.80
projectsMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected