From 3f8e43ce44d698a1127cb58d2e27f825fd944937 Mon Sep 17 00:00:00 2001 From: hallvictoria <59299039+hallvictoria@users.noreply.github.com> Date: Mon, 30 Sep 2024 14:38:30 -0500 Subject: [PATCH] cherry pick changes (#249) Co-authored-by: Victoria Hall --- azure/functions/decorators/blob.py | 2 +- tests/decorators/test_blob.py | 6 +++--- tests/decorators/test_decorators.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/azure/functions/decorators/blob.py b/azure/functions/decorators/blob.py index 1a2d4122..bd2861fa 100644 --- a/azure/functions/decorators/blob.py +++ b/azure/functions/decorators/blob.py @@ -17,7 +17,7 @@ def __init__(self, **kwargs): self.path = path self.connection = connection - self.source = source + self.source = source.value if source else None super().__init__(name=name, data_type=data_type) @staticmethod diff --git a/tests/decorators/test_blob.py b/tests/decorators/test_blob.py index f8712b9f..43926591 100644 --- a/tests/decorators/test_blob.py +++ b/tests/decorators/test_blob.py @@ -42,7 +42,7 @@ def test_blob_trigger_creation_with_default_specified_source(self): "name": "req", "dataType": DataType.UNDEFINED, "path": "dummy_path", - 'source': BlobSource.LOGS_AND_CONTAINER_SCAN, + 'source': 'LogsAndContainerScan', "connection": "dummy_connection" }) @@ -62,7 +62,7 @@ def test_blob_trigger_creation_with_source_as_string(self): "name": "req", "dataType": DataType.UNDEFINED, "path": "dummy_path", - 'source': BlobSource.EVENT_GRID, + 'source': 'EventGrid', "connection": "dummy_connection" }) @@ -82,7 +82,7 @@ def test_blob_trigger_creation_with_source_as_enum(self): "name": "req", "dataType": DataType.UNDEFINED, "path": "dummy_path", - 'source': BlobSource.EVENT_GRID, + 'source': 'EventGrid', "connection": "dummy_connection" }) diff --git a/tests/decorators/test_decorators.py b/tests/decorators/test_decorators.py index 82973ba3..acdd5ccd 100644 --- a/tests/decorators/test_decorators.py +++ b/tests/decorators/test_decorators.py @@ -1628,7 +1628,7 @@ def test_blob_input_binding(): "type": BLOB_TRIGGER, "name": "req", "path": "dummy_path", - "source": BlobSource.EVENT_GRID, + "source": 'EventGrid', "connection": "dummy_conn" })