From cfa7779f41b0cf7aa82ed92c84d35ec49f1b0cc7 Mon Sep 17 00:00:00 2001 From: Victoria Hall Date: Tue, 6 Aug 2024 11:59:25 -0500 Subject: [PATCH 01/11] set functions_bindings to None --- azure/functions/decorators/function_app.py | 6 +++++- tests/decorators/test_function_app.py | 17 +++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/azure/functions/decorators/function_app.py b/azure/functions/decorators/function_app.py index 14af303f..fbfc644a 100644 --- a/azure/functions/decorators/function_app.py +++ b/azure/functions/decorators/function_app.py @@ -204,9 +204,11 @@ def __str__(self): class FunctionBuilder(object): - function_bindings: dict = {} + function_bindings: Optional[Dict[Any, Any]] = None def __init__(self, func, function_script_file): + if self.function_bindings is None: + self.function_bindings = {} self._function = Function(func, function_script_file) def __call__(self, *args, **kwargs): @@ -273,6 +275,8 @@ def _validate_function(self, # This dict contains the function name and its bindings for all # functions in an app. If a previous function has the same name, # indexing will fail here. + if self.function_bindings is None: + self.function_bindings = {} if self.function_bindings.get(function_name, None): raise ValueError( f"Function {function_name} does not have a unique" diff --git a/tests/decorators/test_function_app.py b/tests/decorators/test_function_app.py index b2cd0d96..6ce8c150 100644 --- a/tests/decorators/test_function_app.py +++ b/tests/decorators/test_function_app.py @@ -631,6 +631,23 @@ def test_callable_decorated_type(self): fb = self.func_app._validate_type(self.dummy_func) self.assertTrue(isinstance(fb, FunctionBuilder)) self.assertEqual(fb._function.get_user_function(), self.dummy_func) + + def test_function_builder_initialization(self): + fb = FunctionBuilder(self.dummy_func, "dummy.py") + self.assertEqual(fb.function_bindings, {}) + + self.func_app._function_builders.append(fb) + fb = self.func_app._validate_type(fb) + + self.assertNotEqual(fb.function_bindings, {}) + + fb2 = FunctionBuilder(self.dummy_func, "dummy2.py") + self.assertEqual(fb2.function_bindings, {}) + + self.func_app._function_builders.append(fb2) + fb2 = self.func_app._validate_type(fb2) + + self.assertNotEqual(fb2.function_bindings, {}) def test_function_builder_decorated_type(self): fb = FunctionBuilder(self.dummy_func, "dummy.py") From e62256fe4ab41ab8fddb8387e0add080b11acdc8 Mon Sep 17 00:00:00 2001 From: Victoria Hall Date: Tue, 6 Aug 2024 14:14:28 -0500 Subject: [PATCH 02/11] refactor name tracker to FunctionRegister --- azure/functions/decorators/function_app.py | 38 +++++++--- tests/decorators/test_function_app.py | 84 +++++++++++++--------- 2 files changed, 77 insertions(+), 45 deletions(-) diff --git a/azure/functions/decorators/function_app.py b/azure/functions/decorators/function_app.py index fbfc644a..0f91f4db 100644 --- a/azure/functions/decorators/function_app.py +++ b/azure/functions/decorators/function_app.py @@ -204,11 +204,11 @@ def __str__(self): class FunctionBuilder(object): - function_bindings: Optional[Dict[Any, Any]] = None + # function_bindings: Optional[Dict[Any, Any]] = None + # if function_bindings is None: + # function_bindings = {} def __init__(self, func, function_script_file): - if self.function_bindings is None: - self.function_bindings = {} self._function = Function(func, function_script_file) def __call__(self, *args, **kwargs): @@ -275,14 +275,14 @@ def _validate_function(self, # This dict contains the function name and its bindings for all # functions in an app. If a previous function has the same name, # indexing will fail here. - if self.function_bindings is None: - self.function_bindings = {} - if self.function_bindings.get(function_name, None): - raise ValueError( - f"Function {function_name} does not have a unique" - f" function name. Please change @app.function_name() or" - f" the function method name to be unique.") - self.function_bindings[function_name] = bindings + # if self.function_bindings is None: + # self.function_bindings = {} + # if self.function_bindings.get(function_name, None): + # raise ValueError( + # f"Function {function_name} does not have a unique" + # f" function name. Please change @app.function_name() or" + # f" the function method name to be unique.") + # self.function_bindings[function_name] = bindings def build(self, auth_level: Optional[AuthLevel] = None) -> Function: """ @@ -3280,6 +3280,7 @@ def __init__(self, auth_level: Union[AuthLevel, str], *args, **kwargs): DecoratorApi.__init__(self, *args, **kwargs) HttpFunctionsAuthLevelMixin.__init__(self, auth_level, *args, **kwargs) self._require_auth_level: Optional[bool] = None + self.functions_bindings: Optional[Dict[Any, Any]] = None def get_functions(self) -> List[Function]: """Get the function objects in the function app. @@ -3301,8 +3302,23 @@ def get_functions(self) -> List[Function]: '-bindings-http-webhook-trigger?tabs=in-process' '%2Cfunctionsv2&pivots=programming-language-python#http-auth') + FunctionRegister.validate_functions(self, functions=functions) + return functions + def validate_functions(self, functions: List[Function]) -> bool: + if not self.functions_bindings: + self.functions_bindings = {} + for function in functions: + function_name = function.get_function_name() + if self.functions_bindings.get(function_name, None): + raise ValueError( + f"Function {function_name} does not have a unique" + f" function name. Please change @app.function_name() or" + f" the function method name to be unique.") + self.functions_bindings[function_name] = function.get_bindings() + return True + def register_functions(self, function_container: DecoratorApi) -> None: """Register a list of functions in the function app. diff --git a/tests/decorators/test_function_app.py b/tests/decorators/test_function_app.py index 6ce8c150..fe73e9e0 100644 --- a/tests/decorators/test_function_app.py +++ b/tests/decorators/test_function_app.py @@ -20,7 +20,6 @@ ) from azure.functions.decorators.http import HttpTrigger, HttpOutput, \ HttpMethod -from azure.functions.decorators.timer import TimerTrigger from azure.functions.decorators.retry_policy import RetryPolicy from test_core import DummyTrigger from tests.utils.testutils import assert_json @@ -291,10 +290,6 @@ def test_unique_method_names2(name: str): "test_unique_method_names") self.assertEqual(functions[1].get_function_name(), "test_unique_method_names2") - self.assertIsInstance(app._function_builders[0].function_bindings.get( - "test_unique_method_names")[0], TimerTrigger) - self.assertIsInstance(app._function_builders[0].function_bindings.get( - "test_unique_method_names2")[0], TimerTrigger) def test_unique_function_names(self): app = FunctionApp() @@ -316,10 +311,6 @@ def test_unique_function_names2(name: str): "test_unique_function_names") self.assertEqual(functions[1].get_function_name(), "test_unique_function_names2") - self.assertIsInstance(app._function_builders[0].function_bindings.get( - "test_unique_function_names")[0], TimerTrigger) - self.assertIsInstance(app._function_builders[0].function_bindings.get( - "test_unique_function_names2")[0], TimerTrigger) def test_same_method_names(self): app = FunctionApp() @@ -425,10 +416,6 @@ def test_blueprint_unique_method_names2(name: str): "test_blueprint_unique_method_names") self.assertEqual(functions[1].get_function_name(), "test_blueprint_unique_method_names2") - self.assertIsInstance(app._function_builders[0].function_bindings.get( - "test_blueprint_unique_method_names")[0], TimerTrigger) - self.assertIsInstance(app._function_builders[0].function_bindings.get( - "test_blueprint_unique_method_names2")[0], TimerTrigger) def test_blueprint_unique_function_names(self): app = FunctionApp() @@ -454,10 +441,6 @@ def test_blueprint_unique_function_names2(name: str): "test_blueprint_unique_function_names") self.assertEqual(functions[1].get_function_name(), "test_blueprint_unique_function_names2") - self.assertIsInstance(app._function_builders[0].function_bindings.get( - "test_blueprint_unique_function_names")[0], TimerTrigger) - self.assertIsInstance(app._function_builders[0].function_bindings.get( - "test_blueprint_unique_function_names2")[0], TimerTrigger) def test_blueprint_same_method_names(self): app = FunctionApp() @@ -631,23 +614,6 @@ def test_callable_decorated_type(self): fb = self.func_app._validate_type(self.dummy_func) self.assertTrue(isinstance(fb, FunctionBuilder)) self.assertEqual(fb._function.get_user_function(), self.dummy_func) - - def test_function_builder_initialization(self): - fb = FunctionBuilder(self.dummy_func, "dummy.py") - self.assertEqual(fb.function_bindings, {}) - - self.func_app._function_builders.append(fb) - fb = self.func_app._validate_type(fb) - - self.assertNotEqual(fb.function_bindings, {}) - - fb2 = FunctionBuilder(self.dummy_func, "dummy2.py") - self.assertEqual(fb2.function_bindings, {}) - - self.func_app._function_builders.append(fb2) - fb2 = self.func_app._validate_type(fb2) - - self.assertNotEqual(fb2.function_bindings, {}) def test_function_builder_decorated_type(self): fb = FunctionBuilder(self.dummy_func, "dummy.py") @@ -1026,3 +992,53 @@ def _test_http_external_app(self, app, is_async, function_name): "type": HTTP_OUTPUT } ]}) + + +class TestFunctionRegister(unittest.TestCase): + def test_validate_empty_dict(self): + def dummy(): + return "dummy" + + test_func = Function(dummy, "dummy.py") + test_func.__name__ = "test_func" + + fr = FunctionRegister(auth_level="ANONYMOUS") + + with self.assertRaises(AttributeError) as err: + FunctionRegister.validate_functions(fr, functions=[test_func]) + self.assertEqual(err.exception.args[0], + '"NoneType" object has no attribute "get"') + + def test_validate_unique_names(self): + def dummy(): + return "dummy" + + test_func = Function(dummy, "dummy.py") + test_func.__name__ = "test_func" + test_func2 = Function(dummy, "dummy.py") + test_func2.__name__ = "test_func2" + + fr = FunctionRegister(auth_level="ANONYMOUS") + FunctionRegister.get_functions(fr) + unique_names = FunctionRegister.validate_functions( + fr, functions=[test_func, test_func2]) + self.assertTrue(unique_names) + + def test_validate_non_unique_names(self): + def dummy(): + return "dummy" + + test_func = Function(dummy, "dummy.py") + test_func.__name__ = "test_func" + test_func2 = Function(dummy, "dummy.py") + test_func2.__name__ = "test_func" + + fr = FunctionRegister(auth_level="ANONYMOUS") + FunctionRegister.get_functions(fr) + with self.assertRaises(AttributeError) as err: + FunctionRegister.validate_functions(fr, functions=[test_func]) + self.assertEqual(err.exception.args[0], + "Function test_same_method_names does not have" + " a unique function name." + " Please change @app.function_name()" + " or the function method name to be unique.") From 076ee3704919e4fee130b74e45a0d0aad192c26a Mon Sep 17 00:00:00 2001 From: Victoria Hall Date: Tue, 6 Aug 2024 14:32:30 -0500 Subject: [PATCH 03/11] lint --- azure/functions/decorators/function_app.py | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/azure/functions/decorators/function_app.py b/azure/functions/decorators/function_app.py index 0f91f4db..a37f2208 100644 --- a/azure/functions/decorators/function_app.py +++ b/azure/functions/decorators/function_app.py @@ -204,9 +204,6 @@ def __str__(self): class FunctionBuilder(object): - # function_bindings: Optional[Dict[Any, Any]] = None - # if function_bindings is None: - # function_bindings = {} def __init__(self, func, function_script_file): self._function = Function(func, function_script_file) @@ -272,18 +269,6 @@ def _validate_function(self, parse_singular_param_to_enum(auth_level, AuthLevel)) self._function._is_http_function = True - # This dict contains the function name and its bindings for all - # functions in an app. If a previous function has the same name, - # indexing will fail here. - # if self.function_bindings is None: - # self.function_bindings = {} - # if self.function_bindings.get(function_name, None): - # raise ValueError( - # f"Function {function_name} does not have a unique" - # f" function name. Please change @app.function_name() or" - # f" the function method name to be unique.") - # self.function_bindings[function_name] = bindings - def build(self, auth_level: Optional[AuthLevel] = None) -> Function: """ Validates and builds the function object. @@ -3307,6 +3292,10 @@ def get_functions(self) -> List[Function]: return functions def validate_functions(self, functions: List[Function]) -> bool: + """The functions_bindings dict contains the function name and + its bindings for all functions in an app. If a previous function + has the same name, indexing will fail here. + """ if not self.functions_bindings: self.functions_bindings = {} for function in functions: From 7b784de1be1775291af88b8ef5859e09c81eccba Mon Sep 17 00:00:00 2001 From: Victoria Hall Date: Tue, 6 Aug 2024 16:06:08 -0500 Subject: [PATCH 04/11] renamed validate_functions --- azure/functions/decorators/function_app.py | 4 ++-- tests/decorators/test_function_app.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/azure/functions/decorators/function_app.py b/azure/functions/decorators/function_app.py index a37f2208..fa664b0a 100644 --- a/azure/functions/decorators/function_app.py +++ b/azure/functions/decorators/function_app.py @@ -3287,11 +3287,11 @@ def get_functions(self) -> List[Function]: '-bindings-http-webhook-trigger?tabs=in-process' '%2Cfunctionsv2&pivots=programming-language-python#http-auth') - FunctionRegister.validate_functions(self, functions=functions) + FunctionRegister.validate_function_names(self, functions=functions) return functions - def validate_functions(self, functions: List[Function]) -> bool: + def validate_function_names(self, functions: List[Function]) -> bool: """The functions_bindings dict contains the function name and its bindings for all functions in an app. If a previous function has the same name, indexing will fail here. diff --git a/tests/decorators/test_function_app.py b/tests/decorators/test_function_app.py index fe73e9e0..957dde8d 100644 --- a/tests/decorators/test_function_app.py +++ b/tests/decorators/test_function_app.py @@ -1005,7 +1005,7 @@ def dummy(): fr = FunctionRegister(auth_level="ANONYMOUS") with self.assertRaises(AttributeError) as err: - FunctionRegister.validate_functions(fr, functions=[test_func]) + FunctionRegister.validate_function_names(fr, functions=[test_func]) self.assertEqual(err.exception.args[0], '"NoneType" object has no attribute "get"') @@ -1020,7 +1020,7 @@ def dummy(): fr = FunctionRegister(auth_level="ANONYMOUS") FunctionRegister.get_functions(fr) - unique_names = FunctionRegister.validate_functions( + unique_names = FunctionRegister.validate_function_names( fr, functions=[test_func, test_func2]) self.assertTrue(unique_names) @@ -1036,7 +1036,7 @@ def dummy(): fr = FunctionRegister(auth_level="ANONYMOUS") FunctionRegister.get_functions(fr) with self.assertRaises(AttributeError) as err: - FunctionRegister.validate_functions(fr, functions=[test_func]) + FunctionRegister.validate_function_names(fr, functions=[test_func]) self.assertEqual(err.exception.args[0], "Function test_same_method_names does not have" " a unique function name." From cbb8ec821820ed0b2ffb35ea7d0ff577546d629c Mon Sep 17 00:00:00 2001 From: Victoria Hall Date: Wed, 7 Aug 2024 10:57:09 -0500 Subject: [PATCH 05/11] feedback --- azure/functions/decorators/function_app.py | 11 ++++++----- tests/decorators/test_function_app.py | 3 +-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/azure/functions/decorators/function_app.py b/azure/functions/decorators/function_app.py index fa664b0a..05e91a19 100644 --- a/azure/functions/decorators/function_app.py +++ b/azure/functions/decorators/function_app.py @@ -3287,11 +3287,11 @@ def get_functions(self) -> List[Function]: '-bindings-http-webhook-trigger?tabs=in-process' '%2Cfunctionsv2&pivots=programming-language-python#http-auth') - FunctionRegister.validate_function_names(self, functions=functions) + self.validate_function_names(functions=functions) return functions - def validate_function_names(self, functions: List[Function]) -> bool: + def validate_function_names(self, functions: List[Function]): """The functions_bindings dict contains the function name and its bindings for all functions in an app. If a previous function has the same name, indexing will fail here. @@ -3300,13 +3300,14 @@ def validate_function_names(self, functions: List[Function]) -> bool: self.functions_bindings = {} for function in functions: function_name = function.get_function_name() - if self.functions_bindings.get(function_name, None): + if function_name in self.functions_bindings: raise ValueError( f"Function {function_name} does not have a unique" f" function name. Please change @app.function_name() or" f" the function method name to be unique.") - self.functions_bindings[function_name] = function.get_bindings() - return True + # The value of the key doesn't matter. We're using a dict for + # faster lookup times. + self.functions_bindings[function_name] = True def register_functions(self, function_container: DecoratorApi) -> None: """Register a list of functions in the function app. diff --git a/tests/decorators/test_function_app.py b/tests/decorators/test_function_app.py index 957dde8d..2da595a8 100644 --- a/tests/decorators/test_function_app.py +++ b/tests/decorators/test_function_app.py @@ -1020,9 +1020,8 @@ def dummy(): fr = FunctionRegister(auth_level="ANONYMOUS") FunctionRegister.get_functions(fr) - unique_names = FunctionRegister.validate_function_names( + FunctionRegister.validate_function_names( fr, functions=[test_func, test_func2]) - self.assertTrue(unique_names) def test_validate_non_unique_names(self): def dummy(): From 8229fe5b2b4a3a16c689bcecbf3c7026d03ac9b1 Mon Sep 17 00:00:00 2001 From: Victoria Hall Date: Wed, 7 Aug 2024 12:08:23 -0500 Subject: [PATCH 06/11] missed test fix --- tests/decorators/test_function_app.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/decorators/test_function_app.py b/tests/decorators/test_function_app.py index 2da595a8..2cae2e37 100644 --- a/tests/decorators/test_function_app.py +++ b/tests/decorators/test_function_app.py @@ -1012,11 +1012,11 @@ def dummy(): def test_validate_unique_names(self): def dummy(): return "dummy" + def dummy2(): + return "dummy" test_func = Function(dummy, "dummy.py") - test_func.__name__ = "test_func" - test_func2 = Function(dummy, "dummy.py") - test_func2.__name__ = "test_func2" + test_func2 = Function(dummy2, "dummy.py") fr = FunctionRegister(auth_level="ANONYMOUS") FunctionRegister.get_functions(fr) From 79913d8b2711051dc27bd069a5a9776927381fc4 Mon Sep 17 00:00:00 2001 From: Victoria Hall Date: Wed, 7 Aug 2024 12:11:35 -0500 Subject: [PATCH 07/11] missed test fix --- tests/decorators/test_function_app.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/tests/decorators/test_function_app.py b/tests/decorators/test_function_app.py index 2cae2e37..d85cd78e 100644 --- a/tests/decorators/test_function_app.py +++ b/tests/decorators/test_function_app.py @@ -1028,16 +1028,14 @@ def dummy(): return "dummy" test_func = Function(dummy, "dummy.py") - test_func.__name__ = "test_func" test_func2 = Function(dummy, "dummy.py") - test_func2.__name__ = "test_func" fr = FunctionRegister(auth_level="ANONYMOUS") FunctionRegister.get_functions(fr) - with self.assertRaises(AttributeError) as err: - FunctionRegister.validate_function_names(fr, functions=[test_func]) + with self.assertRaises(ValueError) as err: + FunctionRegister.validate_function_names(fr, functions=[test_func, test_func2]) self.assertEqual(err.exception.args[0], - "Function test_same_method_names does not have" + "Function dummy does not have" " a unique function name." " Please change @app.function_name()" " or the function method name to be unique.") From 5af5ce9c78935d4aa0d94ff8f9bfce04d85764bd Mon Sep 17 00:00:00 2001 From: Victoria Hall Date: Wed, 7 Aug 2024 12:13:08 -0500 Subject: [PATCH 08/11] lint --- tests/decorators/test_function_app.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/decorators/test_function_app.py b/tests/decorators/test_function_app.py index d85cd78e..0ee2b586 100644 --- a/tests/decorators/test_function_app.py +++ b/tests/decorators/test_function_app.py @@ -1000,7 +1000,6 @@ def dummy(): return "dummy" test_func = Function(dummy, "dummy.py") - test_func.__name__ = "test_func" fr = FunctionRegister(auth_level="ANONYMOUS") @@ -1012,6 +1011,7 @@ def dummy(): def test_validate_unique_names(self): def dummy(): return "dummy" + def dummy2(): return "dummy" @@ -1033,7 +1033,8 @@ def dummy(): fr = FunctionRegister(auth_level="ANONYMOUS") FunctionRegister.get_functions(fr) with self.assertRaises(ValueError) as err: - FunctionRegister.validate_function_names(fr, functions=[test_func, test_func2]) + FunctionRegister.validate_function_names( + fr, functions=[test_func, test_func2]) self.assertEqual(err.exception.args[0], "Function dummy does not have" " a unique function name." From 5460b4a419f16d61a04e2d3d88d21950a50fad1c Mon Sep 17 00:00:00 2001 From: Victoria Hall Date: Wed, 7 Aug 2024 13:35:50 -0500 Subject: [PATCH 09/11] fix tests --- tests/decorators/test_function_app.py | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/tests/decorators/test_function_app.py b/tests/decorators/test_function_app.py index 0ee2b586..0f646cb9 100644 --- a/tests/decorators/test_function_app.py +++ b/tests/decorators/test_function_app.py @@ -1000,13 +1000,8 @@ def dummy(): return "dummy" test_func = Function(dummy, "dummy.py") - fr = FunctionRegister(auth_level="ANONYMOUS") - - with self.assertRaises(AttributeError) as err: - FunctionRegister.validate_function_names(fr, functions=[test_func]) - self.assertEqual(err.exception.args[0], - '"NoneType" object has no attribute "get"') + fr.validate_function_names(functions=[test_func]) def test_validate_unique_names(self): def dummy(): @@ -1019,9 +1014,8 @@ def dummy2(): test_func2 = Function(dummy2, "dummy.py") fr = FunctionRegister(auth_level="ANONYMOUS") - FunctionRegister.get_functions(fr) - FunctionRegister.validate_function_names( - fr, functions=[test_func, test_func2]) + fr.validate_function_names( + functions=[test_func, test_func2]) def test_validate_non_unique_names(self): def dummy(): @@ -1031,10 +1025,8 @@ def dummy(): test_func2 = Function(dummy, "dummy.py") fr = FunctionRegister(auth_level="ANONYMOUS") - FunctionRegister.get_functions(fr) with self.assertRaises(ValueError) as err: - FunctionRegister.validate_function_names( - fr, functions=[test_func, test_func2]) + fr.validate_function_names(functions=[test_func, test_func2]) self.assertEqual(err.exception.args[0], "Function dummy does not have" " a unique function name." From a62467582025924d9f6f09f68058adb9d5f04318 Mon Sep 17 00:00:00 2001 From: Victoria Hall Date: Wed, 7 Aug 2024 14:06:51 -0500 Subject: [PATCH 10/11] replace kafka test value --- tests/decorators/test_kafka.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/decorators/test_kafka.py b/tests/decorators/test_kafka.py index 409df275..4fdb8531 100644 --- a/tests/decorators/test_kafka.py +++ b/tests/decorators/test_kafka.py @@ -24,7 +24,7 @@ def test_kafka_trigger_valid_creation(self): ssl_certificate_location="scl", ssl_key_password="ssl_key_password", schema_registry_url="srurl", - schema_registry_username="sruser", + schema_registry_username="username", schema_registry_password="srp", authentication_mode=BrokerAuthenticationMode.PLAIN, # noqa: E501 data_type=DataType.UNDEFINED, @@ -46,7 +46,7 @@ def test_kafka_trigger_valid_creation(self): "protocol": BrokerProtocol.NOTSET, "schemaRegistryPassword": "srp", "schemaRegistryUrl": "srurl", - "schemaRegistryUsername": "sruser", + "schemaRegistryUsername": "username", "sslCaLocation": "ssl_ca_location", "sslCertificateLocation": "scl", "sslKeyLocation": "ssl_key_location", @@ -68,7 +68,7 @@ def test_kafka_output_valid_creation(self): ssl_certificate_location="scl", ssl_key_password="ssl_key_password", schema_registry_url="schema_registry_url", - schema_registry_username="sru", + schema_registry_username="username", schema_registry_password="srp", max_retries=10, data_type=DataType.UNDEFINED, @@ -94,7 +94,7 @@ def test_kafka_output_valid_creation(self): 'requestTimeoutMs': 5000, 'schemaRegistryPassword': 'srp', 'schemaRegistryUrl': 'schema_registry_url', - 'schemaRegistryUsername': 'sru', + 'schemaRegistryUsername': 'username', 'sslCaLocation': 'ssl_ca_location', 'sslCertificateLocation': 'scl', 'sslKeyLocation': 'ssl_key_location', From a9581270e94d6ee7054665eb9a2dae209fc86be5 Mon Sep 17 00:00:00 2001 From: Victoria Hall Date: Wed, 7 Aug 2024 14:19:42 -0500 Subject: [PATCH 11/11] remove kafka test value --- tests/decorators/test_kafka.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/decorators/test_kafka.py b/tests/decorators/test_kafka.py index 4fdb8531..6f0257e8 100644 --- a/tests/decorators/test_kafka.py +++ b/tests/decorators/test_kafka.py @@ -24,7 +24,7 @@ def test_kafka_trigger_valid_creation(self): ssl_certificate_location="scl", ssl_key_password="ssl_key_password", schema_registry_url="srurl", - schema_registry_username="username", + schema_registry_username="", schema_registry_password="srp", authentication_mode=BrokerAuthenticationMode.PLAIN, # noqa: E501 data_type=DataType.UNDEFINED, @@ -46,7 +46,7 @@ def test_kafka_trigger_valid_creation(self): "protocol": BrokerProtocol.NOTSET, "schemaRegistryPassword": "srp", "schemaRegistryUrl": "srurl", - "schemaRegistryUsername": "username", + "schemaRegistryUsername": "", "sslCaLocation": "ssl_ca_location", "sslCertificateLocation": "scl", "sslKeyLocation": "ssl_key_location", @@ -68,7 +68,7 @@ def test_kafka_output_valid_creation(self): ssl_certificate_location="scl", ssl_key_password="ssl_key_password", schema_registry_url="schema_registry_url", - schema_registry_username="username", + schema_registry_username="", schema_registry_password="srp", max_retries=10, data_type=DataType.UNDEFINED, @@ -94,7 +94,7 @@ def test_kafka_output_valid_creation(self): 'requestTimeoutMs': 5000, 'schemaRegistryPassword': 'srp', 'schemaRegistryUrl': 'schema_registry_url', - 'schemaRegistryUsername': 'username', + 'schemaRegistryUsername': '', 'sslCaLocation': 'ssl_ca_location', 'sslCertificateLocation': 'scl', 'sslKeyLocation': 'ssl_key_location',