This is an automated email from the ASF dual-hosted git repository.
jasonliu pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new 0ff8764ec4c add unit tests (#60742)
0ff8764ec4c is described below
commit 0ff8764ec4c27cb1f91be5aabba38962a37a6ac7
Author: Henry Chen <[email protected]>
AuthorDate: Fri Jan 30 14:04:50 2026 +0800
add unit tests (#60742)
---
.../tests/unit/timetables/test_base_timetable.py | 44 ++++++++++++++++++++++
1 file changed, 44 insertions(+)
diff --git a/airflow-core/tests/unit/timetables/test_base_timetable.py
b/airflow-core/tests/unit/timetables/test_base_timetable.py
new file mode 100644
index 00000000000..726d991b23c
--- /dev/null
+++ b/airflow-core/tests/unit/timetables/test_base_timetable.py
@@ -0,0 +1,44 @@
+# 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
+
+from airflow._shared.module_loading import qualname
+
+
+def test_builtin_timetable_type_name_returns_class_name():
+ """Built-in timetables should return just the class name as type_name."""
+ from airflow.timetables.simple import NullTimetable
+
+ tt = NullTimetable()
+ assert tt.type_name == "NullTimetable"
+
+
+def test_custom_timetable_type_name_returns_qualname():
+ """Custom/user-defined timetables should return the full import path
(qualname)."""
+ # Define a custom timetable class that inherits from Timetable so it uses
+ # the default property implementation. Its module will not start with
+ # "airflow.timetables." so type_name should be the qualname.
+ from airflow.timetables.base import Timetable
+
+ class CustomTimetable(Timetable):
+ pass
+
+ inst = CustomTimetable()
+ expected = qualname(inst.__class__)
+
+ # The Timetable.type_name logic should return qualname for custom
timetables
+ assert inst.type_name == expected