예제 #1
0
 def test_init_metadata_store_with_location_override(
         self, get_metadata_store_mock):
     aiplatform.init(project=_TEST_PROJECT, location=_TEST_LOCATION)
     metadata_store._MetadataStore(metadata_store_name=_TEST_ID,
                                   location=_TEST_ALT_LOCATION)
     get_metadata_store_mock.assert_called_once_with(
         name=_TEST_ALT_LOC_NAME)
예제 #2
0
 def test_init_metadata_store_with_invalid_name(self):
     with pytest.raises(ValueError):
         aiplatform.init(project=_TEST_PROJECT, location=_TEST_LOCATION)
         metadata_store._MetadataStore(metadata_store_name=_TEST_INVALID_NAME)
예제 #3
0
 def test_init_metadata_store_with_id_without_project_or_location(self):
     with pytest.raises(GoogleAuthError):
         metadata_store._MetadataStore(
             metadata_store_name=_TEST_ID,
             credentials=auth_credentials.AnonymousCredentials(),
         )
예제 #4
0
 def test_init_metadata_store_with_default_id(self, get_metadata_store_mock):
     aiplatform.init(project=_TEST_PROJECT, location=_TEST_LOCATION)
     metadata_store._MetadataStore()
     get_metadata_store_mock.assert_called_once_with(
         name=_TEST_DEFAULT_NAME, retry=base._DEFAULT_RETRY
     )
예제 #5
0
 def test_init_metadata_store(self, get_metadata_store_mock):
     aiplatform.init(project=_TEST_PROJECT)
     metadata_store._MetadataStore(metadata_store_name=_TEST_NAME)
     get_metadata_store_mock.assert_called_once_with(
         name=_TEST_NAME, retry=base._DEFAULT_RETRY
     )