ferruzzi commented on code in PR #29447:
URL: https://github.com/apache/airflow/pull/29447#discussion_r1102034396


##########
tests/providers/amazon/aws/utils/test_identifiers.py:
##########
@@ -0,0 +1,74 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+from __future__ import annotations
+
+import random
+import string
+import uuid
+
+import pytest
+
+from airflow.providers.amazon.aws.utils.identifiers import generate_uuid
+from airflow.utils.types import NOTSET
+
+
+class TestGenerateUuid:
+    @pytest.fixture(
+        autouse=True,
+        params=[
+            pytest.param(NOTSET, id="default-namespace"),
+            pytest.param(uuid.UUID(int=42), id="custom-namespace"),
+        ],
+    )
+    def setup_namespace(self, request):
+        self.default_namespace = request.param is NOTSET
+        self.namespace = uuid.NAMESPACE_OID if self.default_namespace else 
request.param
+        self.kwargs = {"namespace": self.namespace} if not 
self.default_namespace else {}
+
+    def test_deterministic(self):
+        """Test that result deterministic and valid UUID object"""
+        args = [
+            "".join(random.choice(string.ascii_letters) for _ in 
range(random.randint(3, 13)))
+            for _ in range(100)
+        ]

Review Comment:
   I get what you are doing here and I won't block for this, but I've been 
taught to avoid random values in tests like this and prefer static values.  



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to