Avihais12344 commented on code in PR #41695:
URL: https://github.com/apache/airflow/pull/41695#discussion_r1731607513
##########
tests/models/test_dag.py:
##########
@@ -3720,6 +3720,30 @@ def test__tags_length(tags: list[str], should_pass:
bool):
DAG("test-dag", schedule=None, tags=tags)
[email protected](
+ "input_tags, expected_result",
+ [
+ pytest.param([], set(), id="empty tags"),
+ pytest.param(["a normal tag"], {"a normal tag",}, id="one tag"),
+ pytest.param(["a normal tag", "another normal tag"], {"a normal tag",
"another normal tag"}, id="two different tags"),
+ pytest.param(["a", "a"], {"a",}, id="two same tags"),
+ ],
+)
+def test__tags_duplicates(input_tags: list[str], expected_result: set[str]):
+ result = DAG("test-dag", tags=input_tags)
+ assert result.tags == expected_result
+
+
+def test__tags_mutable():
+ expected_tags = {"6", "7"}
+ test_dag = DAG("test-dag")
+ test_dag.tags.add("6")
+ test_dag.tags.add("7")
+ test_dag.tags.add("8")
+ test_dag.tags.remove("8")
+ assert test_dag.tags == expected_tags
Review Comment:
Overall I want to check behaviour, if we change the behaviour, we should
know about it.
For example, changing the implementation of the tags from `set` to `list`
would break this change, and we would know about it.
That's why I think we should have this test, but let's keep the conversation
[here](https://github.com/apache/airflow/pull/41695#discussion_r1731602684), as
we talk about the same thing.
--
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]