예제 #1
0
 def test_gcs_init(self, google_client):
     result = GCSResult(bucket="bob")
     assert result.value is None
     assert result.bucket == "bob"
     assert google_client.called is False
     result.gcs_bucket()
     assert google_client.return_value.bucket.call_args[0][0] == "bob"
예제 #2
0
    def test_gcs_uses_custom_secret_name(self, google_client):
        result = GCSResult(bucket="foo", credentials_secret="TEST_SECRET")

        with prefect.context(secrets=dict(TEST_SECRET=94611)):
            with set_temporary_config({"cloud.use_local_secrets": True}):
                result.gcs_bucket()

        assert google_client.call_args[1]["credentials"] == 94611